relax some assertions to make tests forward compatible

This commit is contained in:
Christian Flothmann 2019-07-24 21:38:05 +02:00
parent 83e7b45b6d
commit c0eed67aa8
2 changed files with 4 additions and 6 deletions

View File

@ -848,7 +848,8 @@ class EntityTypeTest extends BaseTypeTest
]);
$this->assertEquals([3 => new ChoiceView($entity3, '3', 'Baz'), 2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['preferred_choices']);
$this->assertEquals([1 => new ChoiceView($entity1, '1', 'Foo')], $field->createView()->vars['choices']);
$this->assertArrayHasKey(1, $field->createView()->vars['choices']);
$this->assertEquals(new ChoiceView($entity1, '1', 'Foo'), $field->createView()->vars['choices'][1]);
}
public function testOverrideChoicesWithPreferredChoices()
@ -868,7 +869,8 @@ class EntityTypeTest extends BaseTypeTest
]);
$this->assertEquals([3 => new ChoiceView($entity3, '3', 'Baz')], $field->createView()->vars['preferred_choices']);
$this->assertEquals([2 => new ChoiceView($entity2, '2', 'Bar')], $field->createView()->vars['choices']);
$this->assertArrayHasKey(2, $field->createView()->vars['choices']);
$this->assertEquals(new ChoiceView($entity2, '2', 'Bar'), $field->createView()->vars['choices'][2]);
}
public function testDisallowChoicesThatAreNotIncludedChoicesSingleIdentifier()

View File

@ -404,7 +404,6 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
/following-sibling::option[@disabled="disabled"][not(@selected)][.="-- sep --"]
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
]
[count(./option)=3]
'
);
}
@ -427,7 +426,6 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
]
[count(./option)=2]
'
);
}
@ -451,7 +449,6 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
/following-sibling::option[@disabled="disabled"][not(@selected)][.=""]
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
]
[count(./option)=3]
'
);
}
@ -468,7 +465,6 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
'/select
[@class="my&class form-control"]
[count(./option)=2]
'
);
}