Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2316dc3

Browse files
committed
[FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther
1 parent 58439e3 commit 2316dc3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Test/WebTestAssertionsTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use PHPUnit\Framework\Constraint\LogicalAnd;
1515
use PHPUnit\Framework\Constraint\LogicalNot;
16-
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
16+
use Symfony\Component\BrowserKit\AbstractBrowser;
1717
use Symfony\Component\BrowserKit\Test\Constraint as BrowserKitConstraint;
1818
use Symfony\Component\DomCrawler\Crawler;
1919
use Symfony\Component\DomCrawler\Test\Constraint as DomCrawlerConstraint;
@@ -186,15 +186,15 @@ public static function assertRouteSame($expectedRoute, array $parameters = [], s
186186
self::assertThat(self::getRequest(), $constraint, $message);
187187
}
188188

189-
private static function getClient(KernelBrowser $newClient = null): ?KernelBrowser
189+
private static function getClient(AbstractBrowser $newClient = null): ?AbstractBrowser
190190
{
191191
static $client;
192192

193193
if (0 < \func_num_args()) {
194194
return $client = $newClient;
195195
}
196196

197-
if (!$client instanceof KernelBrowser) {
197+
if (!$client instanceof AbstractBrowser) {
198198
static::fail(sprintf('A client must be set to make assertions on it. Did you forget to call "%s::createClient()"?', __CLASS__));
199199
}
200200

src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorAttributeValueSame.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function matches($crawler): bool
4747
return false;
4848
}
4949

50-
return $this->expectedText === trim($crawler->getNode(0)->getAttribute($this->attribute));
50+
return $this->expectedText === trim($crawler->attr($this->attribute));
5151
}
5252

5353
/**

0 commit comments

Comments
 (0)