Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit46b944f

Browse files
committed
bug#33278 [FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther (dunglas)
This PR was merged into the 4.3 branch.Discussion----------[FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | n/a <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | todo (remove the line telling that these assertions aren't compatible with Panther)Backport of essential fixes provided by#32207. It allows most assertions to work with Panther even when using Symfony 4.3.Commits-------2316dc3 [FrameworkBundle] Fix BrowserKit assertions to make them compatible with Panther
2 parents58439e3 +2316dc3 commit46b944f

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
usePHPUnit\Framework\Constraint\LogicalAnd;
1515
usePHPUnit\Framework\Constraint\LogicalNot;
16-
useSymfony\Bundle\FrameworkBundle\KernelBrowser;
16+
useSymfony\Component\BrowserKit\AbstractBrowser;
1717
useSymfony\Component\BrowserKit\Test\ConstraintasBrowserKitConstraint;
1818
useSymfony\Component\DomCrawler\Crawler;
1919
useSymfony\Component\DomCrawler\Test\ConstraintasDomCrawlerConstraint;
@@ -186,15 +186,15 @@ public static function assertRouteSame($expectedRoute, array $parameters = [], s
186186
self::assertThat(self::getRequest(),$constraint,$message);
187187
}
188188

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

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

197-
if (!$clientinstanceofKernelBrowser) {
197+
if (!$clientinstanceofAbstractBrowser) {
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
returnfalse;
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)

[8]ページ先頭

©2009-2025 Movatter.jp