Skip to content

Commit 2dae755

Browse files
committed
[TEST] Replace stash before finding nested variables in match
1 parent e0956a5 commit 2dae755

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class YamlRunnerTest extends \PHPUnit_Framework_TestCase
4040
/** @var string */
4141
public static $esVersion;
4242

43-
private static $testCounter = 0;
43+
public static $testCounter = 0;
4444

4545
/**
4646
* @return mixed
@@ -458,7 +458,8 @@ private function executeTestCase($test, $testFile, $future)
458458
} elseif (key($settings) === '$body') {
459459
$actual = $response;
460460
} else {
461-
$actual = $this->getNestedVar($response, key($settings));
461+
$path = YamlRunnerTest::replaceWithStash(key($settings), $stash);
462+
$actual = $this->getNestedVar($response, $path);
462463
}
463464

464465
$expected = YamlRunnerTest::replaceWithStash($expected, $stash);
@@ -689,6 +690,8 @@ private function getNestedVar(&$context, $name)
689690
$piece = str_replace('\.', '.', $piece);
690691
if (!is_array($context) || !array_key_exists($piece, $context)) {
691692
// error occurred
693+
echo "Could not find nested property [$piece] in context: ".print_r($context, true);
694+
echo "\nReturning null...";
692695
return null;
693696
}
694697
$context = &$context[$piece];

0 commit comments

Comments
 (0)