Skip to content

Commit

Permalink
[TEST] Make sure property_exists calls only ocurr on objects
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Nov 15, 2016
1 parent 3409a81 commit 30baa0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/Elasticsearch/Tests/YamlRunnerTest.php
Expand Up @@ -266,7 +266,7 @@ public function operationDo($operation, $lastOperationResult, &$context, $testNa
$method = Inflector::camelize($endpointInfo[1]);
}

if (property_exists($endpointParams, 'ignore')) {
if (is_object($endpointParams) === true && property_exists($endpointParams, 'ignore')) {
$ignore = $endpointParams->ignore;
unset($endpointParams->ignore);

Expand Down Expand Up @@ -567,6 +567,10 @@ public function operationSet($operation, $lastOperationResult, &$context, $testN
*/
public function operationSkip($operation, $lastOperationResult, $testName)
{
if (is_object($operation) !== true ) {
return $lastOperationResult;
}

if (property_exists($operation, 'features') && !in_array($operation->features, static::$supportedFeatures, true)) {
static::markTestSkipped(sprintf('Feature(s) %s not supported in test "%s"', json_encode($operation->features), $testName));
}
Expand Down

0 comments on commit 30baa0d

Please sign in to comment.