$this->
assertNotSame($crawler,
$crawler->
selectImage('Bar'
), '->selectImage() returns a new instance of a crawler'
);
$this->
assertInstanceOf(Crawler::
class,
$crawler->
selectImage('Bar'
), '->selectImage() returns a new instance of a crawler'
);
$this->
assertCount(1,
$crawler->
selectImage('Fabien\'s Bar'
), '->selectImage() selects images by alt attribute'
);
$this->
assertCount(2,
$crawler->
selectImage('Fabien"s Bar'
), '->selectImage() selects images by alt attribute'
);
$this->
assertCount(1,
$crawler->
selectImage('\' Fabien"s Bar'
), '->selectImage() selects images by alt attribute'
);
} public function testSelectButton() { $crawler =
$this->
createTestCrawler();
$this->
assertNotSame($crawler,
$crawler->
selectButton('FooValue'
), '->selectButton() returns a new instance of a crawler'
);
$this->
assertInstanceOf(Crawler::
class,
$crawler->
selectButton('FooValue'
), '->selectButton() returns a new instance of a crawler'
);
$this->
assertEquals(1,
$crawler->
selectButton('FooValue'
)->
count(), '->selectButton() selects buttons'
);
$this->
assertEquals(1,
$crawler->
selectButton('FooName'
)->
count(), '->selectButton() selects buttons'
);
$this->
assertEquals(1,
$crawler->
selectButton('FooId'
)->
count(), '->selectButton() selects buttons'
);
$this->
assertEquals(1,
$crawler->
selectButton('BarValue'
)->
count(), '->selectButton() selects buttons'
);
$this->
assertEquals(1,
$crawler->
selectButton('BarName'
)->
count(), '->selectButton() selects buttons'
);
$this->
assertEquals(1,
$crawler->
selectButton('BarId'
)->
count(), '->selectButton() selects buttons'
);
$this->
assertEquals(1,
$crawler->
selectButton('FooBarValue'
)->
count(), '->selectButton() selects buttons with form attribute too'
);