|
14 | 14 | use PHPUnit\Framework\TestCase;
|
15 | 15 | use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
|
16 | 16 | use Symfony\Component\DomCrawler\Crawler;
|
| 17 | +use Symfony\Component\DomCrawler\Form; |
| 18 | +use Symfony\Component\DomCrawler\Image; |
| 19 | +use Symfony\Component\DomCrawler\Link; |
17 | 20 |
|
18 | 21 | abstract class AbstractCrawlerTest extends TestCase
|
19 | 22 | {
|
@@ -713,7 +716,7 @@ public function testSelectButtonWithDoubleQuotesInNameAttribute()
|
713 | 716 | public function testLink()
|
714 | 717 | {
|
715 | 718 | $crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo');
|
716 |
| - $this->assertInstanceOf(\Symfony\Component\DomCrawler\Link::class, $crawler->link(), '->link() returns a Link instance'); |
| 719 | + $this->assertInstanceOf(Link::class, $crawler->link(), '->link() returns a Link instance'); |
717 | 720 |
|
718 | 721 | $this->assertEquals('POST', $crawler->link('post')->getMethod(), '->link() takes a method as its argument');
|
719 | 722 |
|
@@ -747,7 +750,7 @@ public function testInvalidLinks()
|
747 | 750 | public function testImage()
|
748 | 751 | {
|
749 | 752 | $crawler = $this->createTestCrawler('http://example.com/bar/')->selectImage('Bar');
|
750 |
| - $this->assertInstanceOf(\Symfony\Component\DomCrawler\Image::class, $crawler->image(), '->image() returns an Image instance'); |
| 753 | + $this->assertInstanceOf(Image::class, $crawler->image(), '->image() returns an Image instance'); |
751 | 754 |
|
752 | 755 | try {
|
753 | 756 | $this->createTestCrawler()->filterXPath('//ol')->image();
|
@@ -823,8 +826,8 @@ public function testForm()
|
823 | 826 | $testCrawler = $this->createTestCrawler('http://example.com/bar/');
|
824 | 827 | $crawler = $testCrawler->selectButton('FooValue');
|
825 | 828 | $crawler2 = $testCrawler->selectButton('FooBarValue');
|
826 |
| - $this->assertInstanceOf(\Symfony\Component\DomCrawler\Form::class, $crawler->form(), '->form() returns a Form instance'); |
827 |
| - $this->assertInstanceOf(\Symfony\Component\DomCrawler\Form::class, $crawler2->form(), '->form() returns a Form instance'); |
| 829 | + $this->assertInstanceOf(Form::class, $crawler->form(), '->form() returns a Form instance'); |
| 830 | + $this->assertInstanceOf(Form::class, $crawler2->form(), '->form() returns a Form instance'); |
828 | 831 |
|
829 | 832 | $this->assertEquals($crawler->form()->getFormNode()->getAttribute('id'), $crawler2->form()->getFormNode()->getAttribute('id'), '->form() works on elements with form attribute');
|
830 | 833 |
|
|
0 commit comments