From 9c730ed3db86483d9b2c2b804e65bfee245a1f2d Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Thu, 27 Sep 2018 23:40:21 +0200 Subject: [PATCH] Fix resolve current with range references (#955) --- .../Resolver/Value/Chainable/EvaluatedValueResolver.php | 4 ++++ tests/Loader/LoaderIntegrationTest.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Generator/Resolver/Value/Chainable/EvaluatedValueResolver.php b/src/Generator/Resolver/Value/Chainable/EvaluatedValueResolver.php index bad291f7e..16afe39ca 100644 --- a/src/Generator/Resolver/Value/Chainable/EvaluatedValueResolver.php +++ b/src/Generator/Resolver/Value/Chainable/EvaluatedValueResolver.php @@ -58,6 +58,10 @@ public function resolve( $_scope = $scope; try { $_scope['current'] = $fixture->getValueForCurrent(); + + if ($_scope['current'] instanceof FixtureInterface) { + $_scope['current'] = $fixtureSet->getObjects()->get($_scope['current'])->getInstance(); + } } catch (NoValueForCurrentException $exception) { // Continue } diff --git a/tests/Loader/LoaderIntegrationTest.php b/tests/Loader/LoaderIntegrationTest.php index 291f04a90..759b2929c 100644 --- a/tests/Loader/LoaderIntegrationTest.php +++ b/tests/Loader/LoaderIntegrationTest.php @@ -677,7 +677,7 @@ public function testLoadReferenceRange() ], 'userdetail_single_{@user1}' => [ 'email' => '', - 'user' => '', + 'user' => '<($current)>', ], ], ];