mailer-test
mailer-test copied to clipboard
Test email html crawler and assertions
Would be nice to access the crawler and make assertions on the html:
$email->html()->crawler(); // Symfony\Component\DomCrawler\Crawler
$email->html() // same assertion API as zenstruck/browser
->assertSee('some text')
->assertNotSee('some text')
->assertSeeIn('h1', 'some text')
->assertNotSeeIn('h1', 'some text')
->assertSeeElement('h1')
->assertNotSeeElement('h1')
->assertElementCount('ul li', 2)
->assertElementAttributeContains('head meta[name=description]', 'content', 'my description')
->assertElementAttributeNotContains('head meta[name=description]', 'content', 'my description')
;