Skip to content

relax some assertions to make tests forward compatible #32728

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
relax some assertions to make tests forward compatible
  • Loading branch information
xabbuh committed Jul 24, 2019
commit c0eed67aa87c2d25f62b5637365d3c6e0b79d4fe
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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