Skip to content

Commit 30baa0d

Browse files
committed
[TEST] Make sure property_exists calls only ocurr on objects
1 parent 3409a81 commit 30baa0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function operationDo($operation, $lastOperationResult, &$context, $testNa
266266
$method = Inflector::camelize($endpointInfo[1]);
267267
}
268268

269-
if (property_exists($endpointParams, 'ignore')) {
269+
if (is_object($endpointParams) === true && property_exists($endpointParams, 'ignore')) {
270270
$ignore = $endpointParams->ignore;
271271
unset($endpointParams->ignore);
272272

@@ -567,6 +567,10 @@ public function operationSet($operation, $lastOperationResult, &$context, $testN
567567
*/
568568
public function operationSkip($operation, $lastOperationResult, $testName)
569569
{
570+
if (is_object($operation) !== true ) {
571+
return $lastOperationResult;
572+
}
573+
570574
if (property_exists($operation, 'features') && !in_array($operation->features, static::$supportedFeatures, true)) {
571575
static::markTestSkipped(sprintf('Feature(s) %s not supported in test "%s"', json_encode($operation->features), $testName));
572576
}

0 commit comments

Comments
 (0)