Skip to content

Commit 6085bf1

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: relax some assertions to make tests forward compatible fix typo
2 parents 6181df9 + da6aca6 commit 6085bf1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ install:
214214
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
215215
216216
- |
217-
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number than the next one
217+
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
218218
[[ $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
219219
220220
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev

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

+4-2
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

-4
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ public function testSingleChoiceWithPreferred()
441441
/following-sibling::option[@disabled="disabled"][not(@selected)][.="-- sep --"]
442442
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
443443
]
444-
[count(./option)=3]
445444
'
446445
);
447446
}
@@ -464,7 +463,6 @@ public function testSingleChoiceWithPreferredAndNoSeparator()
464463
./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
465464
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
466465
]
467-
[count(./option)=2]
468466
'
469467
);
470468
}
@@ -488,7 +486,6 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()
488486
/following-sibling::option[@disabled="disabled"][not(@selected)][.=""]
489487
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
490488
]
491-
[count(./option)=3]
492489
'
493490
);
494491
}
@@ -505,7 +502,6 @@ public function testChoiceWithOnlyPreferred()
505502
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
506503
'/select
507504
[@class="my&class form-control"]
508-
[count(./option)=2]
509505
'
510506
);
511507
}

0 commit comments

Comments
 (0)