22
33declare (strict_types=1 );
44
5- use Codeception \PHPUnit \ Constraint \CrawlerNot ;
5+ use Codeception \Constraint \CrawlerNot as CrawlerNotConstraint ;
66use Codeception \PHPUnit \TestCase ;
77use PHPUnit \Framework \AssertionFailedError ;
8+ use Symfony \Component \DomCrawler \Crawler as DomCrawler ;
89
910final class CrawlerNotConstraintTest extends TestCase
1011{
11- protected ?CrawlerNot $ constraint = null ;
12+ protected ?CrawlerNotConstraint $ constraint = null ;
1213
1314 public function _setUp ()
1415 {
15- $ this ->constraint = new Codeception \ PHPUnit \ Constraint \ CrawlerNot ('warcraft ' , '/user ' );
16+ $ this ->constraint = new CrawlerNotConstraint ('warcraft ' , '/user ' );
1617 }
1718
1819 public function testEvaluation ()
1920 {
20- $ nodes = new Symfony \ Component \ DomCrawler \ Crawler ("<p>Bye world</p><p>Hello world</p> " );
21+ $ nodes = new DomCrawler ("<p>Bye world</p><p>Hello world</p> " );
2122 $ this ->constraint ->evaluate ($ nodes );
2223 }
2324
2425 public function testFailMessageResponse ()
2526 {
26- $ nodes = new Symfony \ Component \ DomCrawler \ Crawler ('<p>Bye world</p><p>Bye warcraft</p> ' );
27+ $ nodes = new DomCrawler ('<p>Bye world</p><p>Bye warcraft</p> ' );
2728 try {
2829 $ this ->constraint ->evaluate ($ nodes ->filter ('p ' ), 'selector ' );
2930 } catch (AssertionFailedError $ fail ) {
@@ -43,7 +44,7 @@ public function testFailMessageResponseWhenMoreNodes()
4344 $ html .= "<p>warcraft {$ i }</p> " ;
4445 }
4546
46- $ nodes = new Symfony \ Component \ DomCrawler \ Crawler ($ html );
47+ $ nodes = new DomCrawler ($ html );
4748 try {
4849 $ this ->constraint ->evaluate ($ nodes ->filter ('p ' ), 'selector ' );
4950 } catch (AssertionFailedError $ fail ) {
@@ -58,8 +59,8 @@ public function testFailMessageResponseWhenMoreNodes()
5859
5960 public function testFailMessageResponseWithoutUrl ()
6061 {
61- $ this ->constraint = new Codeception \ PHPUnit \ Constraint \ CrawlerNot ('warcraft ' );
62- $ nodes = new Symfony \ Component \ DomCrawler \ Crawler ('<p>Bye world</p><p>Bye warcraft</p> ' );
62+ $ this ->constraint = new CrawlerNotConstraint ('warcraft ' );
63+ $ nodes = new DomCrawler ('<p>Bye world</p><p>Bye warcraft</p> ' );
6364 try {
6465 $ this ->constraint ->evaluate ($ nodes ->filter ('p ' ), 'selector ' );
6566 } catch (AssertionFailedError $ fail ) {
0 commit comments