@@ 93-108 (lines=16) @@ | ||
90 | $this->assertSame($expected, $scope->toJson()); |
|
91 | } |
|
92 | ||
93 | public function testGetCurrentScope() |
|
94 | { |
|
95 | $manager = new Manager(); |
|
96 | ||
97 | $resource = new Item(['name' => 'Larry Ullman'], function () { |
|
98 | }); |
|
99 | ||
100 | $scope = new Scope($manager, $resource, 'book'); |
|
101 | $this->assertSame('book', $scope->getScopeIdentifier()); |
|
102 | ||
103 | $childScope = $scope->embedChildScope('author', $resource); |
|
104 | $this->assertSame('author', $childScope->getScopeIdentifier()); |
|
105 | ||
106 | $grandChildScope = $childScope->embedChildScope('profile', $resource); |
|
107 | $this->assertSame('profile', $grandChildScope->getScopeIdentifier()); |
|
108 | } |
|
109 | ||
110 | public function testGetIdentifier() |
|
111 | { |
|
@@ 110-125 (lines=16) @@ | ||
107 | $this->assertSame('profile', $grandChildScope->getScopeIdentifier()); |
|
108 | } |
|
109 | ||
110 | public function testGetIdentifier() |
|
111 | { |
|
112 | $manager = new Manager(); |
|
113 | ||
114 | $resource = new Item(['name' => 'Larry Ullman'], function () { |
|
115 | }); |
|
116 | ||
117 | $scope = new Scope($manager, $resource, 'book'); |
|
118 | $this->assertSame('book', $scope->getIdentifier()); |
|
119 | ||
120 | $childScope = $scope->embedChildScope('author', $resource); |
|
121 | $this->assertSame('book.author', $childScope->getIdentifier()); |
|
122 | ||
123 | $grandChildScope = $childScope->embedChildScope('profile', $resource); |
|
124 | $this->assertSame('book.author.profile', $grandChildScope->getIdentifier()); |
|
125 | } |
|
126 | ||
127 | public function testGetParentScopes() |
|
128 | { |