diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2014-11-13 21:35:48 +0100 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2014-11-13 21:35:48 +0100 |
commit | 717129e082894cbf64180c0fbb904a3c8941147b (patch) | |
tree | 58e96650ca7952a0cc03554176fc06cf5e5ad8df | |
parent | 6be0d86e739758049d047cd8364f9efe6cb7fb66 (diff) | |
download | Registry-717129e082894cbf64180c0fbb904a3c8941147b.zip Registry-717129e082894cbf64180c0fbb904a3c8941147b.tar.gz Registry-717129e082894cbf64180c0fbb904a3c8941147b.tar.bz2 |
Test value, protocol and references.2.14.11.15
-rw-r--r-- | Test/Unit/Registry.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Test/Unit/Registry.php b/Test/Unit/Registry.php index 46e3cac..972b18a 100644 --- a/Test/Unit/Registry.php +++ b/Test/Unit/Registry.php @@ -137,4 +137,38 @@ class Registry extends Test\Unit\Suite { ->string($result) ->isEqualTo($value); } + + public function case_value_protocol_and_references ( ) { + + $this + ->given( + $string = $this->realdom->string('a', 'z', 5), + $object = $this->realdom->class('StdClass'), + $key = $this->sample($string), + $value = $this->sample($object), + LUT::set($key, $value) + ) + ->when( + $result1 = resolve('hoa://Library/Registry#' . $key), + $result2 = LUT::get($key) + ) + ->then + ->object($result1) + ->isInstanceOf('StdClass') + ->isIdenticalTo($value) + ->isIdenticalTo($result2) + + ->given($dummy = $this->sample($string)) + ->when( + $result1->foo = $dummy, + $result3 = resolve('hoa://Library/Registry#' . $key) + ) + ->then + ->object($result1) + ->isIdenticalTo($result2) + ->isIdenticalTo($result3) + + ->string($result1->foo) + ->isEqualTo($dummy); + } } |