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

Appearance settings

Commit 4dc833d

Browse filesBrowse files
committed
Fix checkboxes check assertions
1 parent 7616c8d commit 4dc833d
Copy full SHA for 4dc833d

File tree

1 file changed

+2
-6
lines changed
Filter options

1 file changed

+2
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Test/DomCrawlerAssertionsTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Test/DomCrawlerAssertionsTrait.php
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use PHPUnit\Framework\Constraint\LogicalNot;
1616
use Symfony\Component\DomCrawler\Crawler;
1717
use Symfony\Component\DomCrawler\Test\Constraint as DomCrawlerConstraint;
18-
use Symfony\Component\DomCrawler\Test\Constraint\CrawlerSelectorAttributeValueSame;
1918
use Symfony\Component\DomCrawler\Test\Constraint\CrawlerSelectorExists;
2019

2120
/**
@@ -87,17 +86,14 @@ public static function assertInputValueNotSame(string $fieldName, string $expect
8786

8887
public static function assertCheckboxChecked(string $fieldName, string $message = ''): void
8988
{
90-
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
91-
new CrawlerSelectorExists("input[name=\"$fieldName\"]"),
92-
new CrawlerSelectorAttributeValueSame("input[name=\"$fieldName\"]", 'checked', 'checked')
93-
), $message);
89+
self::assertThat(self::getCrawler(), new CrawlerSelectorExists("input[name=\"$fieldName\"]:checked"), $message);
9490
}
9591

9692
public static function assertCheckboxNotChecked(string $fieldName, string $message = ''): void
9793
{
9894
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
9995
new CrawlerSelectorExists("input[name=\"$fieldName\"]"),
100-
new LogicalNot(new CrawlerSelectorAttributeValueSame("input[name=\"$fieldName\"]", 'checked', 'checked'))
96+
new LogicalNot(new CrawlerSelectorExists("input[name=\"$fieldName\"]:checked"))
10197
), $message);
10298
}
10399

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.