Skip to content

MQE-837: Assert sub-elements can't be declared out of sequence #44

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 4 commits into from
Mar 2, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,22 @@ public function trimAssertionAttributes()
return;
}

/** MQE-683 DEPRECATE OLD METHOD HERE
* Unnecessary validation, only needed for backwards compatibility
*/
$singleChildTypes = ['assertEmpty', 'assertFalse', 'assertFileExists', 'assertFileNotExists',
'assertIsEmpty', 'assertNotEmpty', 'assertNotNull', 'assertNull', 'assertTrue',
'assertElementContainsAttribute'];

if (!in_array($this->type, $singleChildTypes)) {
if (!in_array('expectedResult', $relevantAssertionAttributes)
|| !in_array('actualResult', $relevantAssertionAttributes)) {
// @codingStandardsIgnoreStart
throw new TestReferenceException("{$this->type} must have both an expectedResult and actualResult defined (stepKey: {$this->stepKey})");
// @codingStandardsIgnoreEnd
}
}

// Flatten nested Elements's type and value into key=>value entries
foreach ($this->actionAttributes as $key => $subAttributes) {
if (in_array($key, $relevantKeys)) {
Expand Down
Loading