@@ -56,7 +56,6 @@ class ActionObject
56
56
"command " ,
57
57
"html "
58
58
];
59
- const OLD_ASSERTION_ATTRIBUTES = ["expected " , "expectedType " , "actual " , "actualType " ];
60
59
const ASSERTION_ATTRIBUTES = ["expectedResult " => "expected " , "actualResult " => "actual " ];
61
60
const ASSERTION_TYPE_ATTRIBUTE = "type " ;
62
61
const ASSERTION_VALUE_ATTRIBUTE = "value " ;
@@ -303,33 +302,13 @@ public function resolveReferences()
303
302
public function trimAssertionAttributes ()
304
303
{
305
304
$ actionAttributeKeys = array_keys ($ this ->actionAttributes );
306
-
307
- /** MQE-683 DEPRECATE OLD METHOD HERE
308
- * Checks if action has any of the old, single line attributes
309
- * Throws a warning and returns, assuming old syntax is used.
310
- */
311
- $ oldAttributes = array_intersect ($ actionAttributeKeys , ActionObject::OLD_ASSERTION_ATTRIBUTES );
312
- if (!empty ($ oldAttributes )) {
313
- $ appConfig = MftfApplicationConfig::getConfig ();
314
- if ($ appConfig ->getPhase () == MftfApplicationConfig::GENERATION_PHASE && $ appConfig ->verboseEnabled ()) {
315
- LoggingUtil::getInstance ()->getLogger (ActionObject::class)->deprecation (
316
- "use of one line Assertion actions will be deprecated in MFTF 3.0.0, please use nested syntax " ,
317
- ["action " => $ this ->type , "stepKey " => $ this ->stepKey ],
318
- true
319
- );
320
- }
321
- return ;
322
- }
323
-
324
305
$ relevantKeys = array_keys (ActionObject::ASSERTION_ATTRIBUTES );
325
306
$ relevantAssertionAttributes = array_intersect ($ actionAttributeKeys , $ relevantKeys );
326
307
327
308
if (empty ($ relevantAssertionAttributes )) {
328
309
return ;
329
310
}
330
311
331
- $ this ->validateAssertionSchema ($ relevantAssertionAttributes );
332
-
333
312
// Flatten nested Elements's type and value into key=>value entries
334
313
foreach ($ this ->actionAttributes as $ key => $ subAttributes ) {
335
314
if (in_array ($ key , $ relevantKeys )) {
@@ -343,32 +322,6 @@ public function trimAssertionAttributes()
343
322
}
344
323
}
345
324
346
- /**
347
- * Validates that the given assertion attributes have valid schema according to nested assertion syntax.
348
- * @param array $attributes
349
- * @return void
350
- * @throws TestReferenceException
351
- */
352
- private function validateAssertionSchema ($ attributes )
353
- {
354
- /** MQE-683 DEPRECATE OLD METHOD HERE
355
- * Unnecessary validation, only needed for backwards compatibility
356
- */
357
- $ singleChildTypes = ['assertEmpty ' , 'assertFalse ' , 'assertFileExists ' , 'assertFileNotExists ' ,
358
- 'assertIsEmpty ' , 'assertNotEmpty ' , 'assertNotNull ' , 'assertNull ' , 'assertTrue ' ,
359
- 'assertElementContainsAttribute ' ];
360
-
361
- if (!in_array ($ this ->type , $ singleChildTypes )) {
362
- if (!in_array ('expectedResult ' , $ attributes )
363
- || !in_array ('actualResult ' , $ attributes )) {
364
- throw new TestReferenceException (
365
- "{$ this ->type } must have both an expectedResult & actualResult defined (stepKey: {$ this ->stepKey }) " ,
366
- ["action " => $ this ->type , "stepKey " => $ this ->stepKey ]
367
- );
368
- }
369
- }
370
- }
371
-
372
325
/**
373
326
* Look up the selector for SomeSectionName.ElementName and set it as the selector attribute in the
374
327
* resolved custom attributes. Also set the timeout value.
0 commit comments