Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relax some assertions to make tests forward compatible #32728

Merged
merged 1 commit into from Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -848,7 +848,8 @@ public function testPreferredChoices()
]);

$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()
Expand All @@ -868,7 +869,8 @@ public function testOverrideChoicesWithPreferredChoices()
]);

$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()
Expand Down
Expand Up @@ -404,7 +404,6 @@ public function testSingleChoiceWithPreferred()
/following-sibling::option[@disabled="disabled"][not(@selected)][.="-- sep --"]
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
]
[count(./option)=3]
'
);
}
Expand All @@ -427,7 +426,6 @@ public function testSingleChoiceWithPreferredAndNoSeparator()
./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
]
[count(./option)=2]
'
);
}
Expand All @@ -451,7 +449,6 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()
/following-sibling::option[@disabled="disabled"][not(@selected)][.=""]
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
]
[count(./option)=3]
'
);
}
Expand All @@ -468,7 +465,6 @@ public function testChoiceWithOnlyPreferred()
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
'/select
[@class="my&class form-control"]
[count(./option)=2]
'
);
}
Expand Down