Skip to content

Commit

Permalink
[TEST] Regex to detect "stashed" values is not useful, throws false-p…
Browse files Browse the repository at this point in the history
…ositives
  • Loading branch information
polyfractal committed Sep 16, 2016
1 parent a9ee47d commit 7ff9b20
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/Elasticsearch/Tests/YamlRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,10 @@ private function replaceWithContext($data, $context)
return $data;
}

if (is_string($data) && preg_match('/\$.+?$/', $data)) {
if (!array_key_exists($data, $context)) {
static::fail(sprintf('Cannot find variable %s in context', $data));
if (is_string($data)) {
if (array_key_exists($data, $context)) {
return $context[$data];
}

return $context[$data];
}

if (!is_array($data) && !$data instanceof \stdClass) {
Expand Down

0 comments on commit 7ff9b20

Please sign in to comment.