summaryrefslogtreecommitdiff
path: root/server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php
diff options
context:
space:
mode:
authorLoic GUEGAN <loic@Manzerbredes.home>2016-04-16 19:10:27 +0200
committerLoic GUEGAN <loic@Manzerbredes.home>2016-04-16 19:10:27 +0200
commita3ff4d243e2ac37d4516ae56ff86985eadc00eb8 (patch)
tree32e71c42855cc46d95d9c6b74ad2c145eb9ec7eb /server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php
parent396c90f921c30de2d15d2ce52d5d1beabf8eb52d (diff)
parent31d2d0c158ad4daa3dde7a905f3c2e312c194f2e (diff)
Test
Diffstat (limited to 'server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php')
-rwxr-xr-xserver/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php70
1 files changed, 0 insertions, 70 deletions
diff --git a/server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php b/server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php
deleted file mode 100755
index 1410076..0000000
--- a/server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
-namespace OpenCloud\Test\Common;
-
-use OpenCloud\Common\JsonPath;
-
-class JsonPathTest extends \PHPUnit_Framework_TestCase
-{
- private $jsonPath;
-
- public function setUp()
- {
- $this->jsonPath = new JsonPath([]);
- }
-
- public function test_it_sets_values_according_to_paths()
- {
- $this->jsonPath->set('foo.bar.baz', 'VALUE');
-
- $expected = [
- 'foo' => [
- 'bar' => [
- 'baz' => 'VALUE',
- ]
- ]
- ];
-
- $this->assertEquals($expected, $this->jsonPath->getStructure());
- }
-
- public function test_it_sets_arrays_according_to_paths()
- {
- $jsonPath = new JsonPath([
- 'foo' => [
- 'bar' => [
- 'value' => 'VALUE',
- ]
- ]
- ]);
-
- $jsonPath->set('foo.bar.items', ['item_1', 'item_2']);
-
- $expected = [
- 'foo' => [
- 'bar' => [
- 'value' => 'VALUE',
- 'items' => ['item_1', 'item_2'],
- ]
- ]
- ];
-
- $this->assertEquals($expected, $jsonPath->getStructure());
- }
-
- public function test_it_gets_values_according_to_paths()
- {
- $jsonPath = new JsonPath([
- 'foo' => [
- 'bar' => [
- 'baz' => 'VALUE_1',
- 'lol' => 'VALUE_2',
- ]
- ]
- ]);
-
- $this->assertEquals('VALUE_1', $jsonPath->get('foo.bar.baz'));
- $this->assertEquals('VALUE_2', $jsonPath->get('foo.bar.lol'));
- $this->assertNull($jsonPath->get('foo.bar.boo'));
- }
-}