diff --git a/tests/Executor/ResolveTest.php b/tests/Executor/ResolveTest.php index a459c9e..49e23b6 100644 --- a/tests/Executor/ResolveTest.php +++ b/tests/Executor/ResolveTest.php @@ -69,14 +69,7 @@ class ResolveTest extends \PHPUnit_Framework_TestCase $_secret = 'secretValue' . uniqid(); $source = [ - 'test' => new class($_secret) { - public function __construct($_secret) { - $this->_secret = $_secret; - } - public function __invoke() { - return $this->_secret; - } - } + 'test' => new ResolveTestCallableFixture($_secret) ]; $this->assertEquals( ['data' => ['test' => $_secret]], @@ -139,3 +132,18 @@ class ResolveTest extends \PHPUnit_Framework_TestCase ); } } + +class ResolveTestCallableFixture +{ + private $value; + + public function __construct($value) + { + $this->value = $value; + } + + public function __invoke($root, $args, $context) + { + return $this->value; + } +}