From bc502b66b8c45b7bbc7e431a7424294dc1b92161 Mon Sep 17 00:00:00 2001 From: Ivan Vegner Date: Wed, 2 Aug 2017 12:55:37 +0300 Subject: [PATCH] Fix typo --- src/Value.php | 2 +- tests/ContainerTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Value.php b/src/Value.php index b29a092..bf10cdf 100644 --- a/src/Value.php +++ b/src/Value.php @@ -10,6 +10,6 @@ public function __construct($value) { } public function getValue() { - return $value; + return $this->value; } } diff --git a/tests/ContainerTest.php b/tests/ContainerTest.php index 8f33c25..6b041b4 100644 --- a/tests/ContainerTest.php +++ b/tests/ContainerTest.php @@ -6,6 +6,15 @@ use SD\DependencyInjection\Exception; class ContainerTest extends TestCase { + public function testRegisterValue() { + $container = new Container(); + $name = 'name'; + $value = new \stdClass(); + $container->register($name, $container->value($value)); + $result = $container->get($name); + $this->assertEquals($value, $result, 'Must return wrapped value as is'); + } + public function testRegisterClassName() { $name = 'Padme'; $container = new Container(