8000 Merge branch '4.2' into 4.3 · symfony/symfony@327fb95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 327fb95

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: relax some assertions to make tests forward compatible fix typo
2 parents d320cbf + 6085bf1 commit 327fb95

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ install:
222222
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
223223
224224
- |
225-
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number than the next one
225+
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
226226
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]] && LEGACY=,legacy
227227
228228
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,8 @@ public function testPreferredChoices()
848848
]);
849849

850850
$this->assertEquals([3 => new ChoiceView($entity3, '3', 'Baz'), 2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['preferred_choices']);
851-
$this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo')], $field->createView()->vars['choices']);
851+
$this->assertArrayHasKey(1, $field->createView()->vars['choices']);
852+
$this->assertEquals(new ChoiceView($entity1, '1', 'Foo'), $field->createView()->vars['choices'][1]);
852853
}
853854

854855
public function testOverrideChoicesWithPreferredChoices()
@@ -868,7 +869,8 @@ public function testOverrideChoicesWithPreferredChoices()
868869
]);
869870

870871
$this->assertEquals([3 => new ChoiceView($entity3, '3', 'Baz')], $field->createView()->vars['preferred_choices']);
871-
$this->assertEquals([2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['choices']);
872+
$this->assertArrayHasKey(2, $field->createView()->vars['choices']);
873+
$this->assertEquals(new ChoiceView($entity2, '2', 'Bar'), $field->createView()->vars['choices'][2]);
872874
}
873875

874876
public function testDisallowChoicesThatAreNotIncludedChoicesSingleIdentifier()

src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ public function testSingleChoiceWithPreferred()
525525
/following-sibling::option[@disabled="disabled"][not(@selected)][.="-- sep --"]
526526
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
527527
]
528-
[count(./option)=3]
529528
'
530529
);
531530
}
@@ -548,7 +547,6 @@ public function testSingleChoiceWithPreferredAndNoSeparator()
548547
./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
549548
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
550549
]
551-
[count(./option)=2]
552550
'
553551
);
554552
}
@@ -572,7 +570,6 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()
572570
/following-sibling::option[@disabled="disabled"][not(@selected)][.=""]
573571
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
574572
]
575-
[count(./option)=3]
576573
'
577574
);
578575
}
@@ -589,7 +586,6 @@ public function testChoiceWithOnlyPreferred()
589586
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
590587
'/select
591588
[@class="my&class form-control"]
592-
[count(./option)=2]
593589
'
594590
);
595591
}

0 commit comments

Comments
 (0)
0