@@ 117-132 (lines=16) @@ | ||
114 | $this->assertSame($expected, $scope->toJson(JSON_PRETTY_PRINT)); |
|
115 | } |
|
116 | ||
117 | public function testGetCurrentScope() |
|
118 | { |
|
119 | $manager = new Manager(); |
|
120 | ||
121 | $resource = new Item(['name' => 'Larry Ullman'], function () { |
|
122 | }); |
|
123 | ||
124 | $scope = new Scope($manager, $resource, 'book'); |
|
125 | $this->assertSame('book', $scope->getScopeIdentifier()); |
|
126 | ||
127 | $childScope = $scope->embedChildScope('author', $resource); |
|
128 | $this->assertSame('author', $childScope->getScopeIdentifier()); |
|
129 | ||
130 | $grandChildScope = $childScope->embedChildScope('profile', $resource); |
|
131 | $this->assertSame('profile', $grandChildScope->getScopeIdentifier()); |
|
132 | } |
|
133 | ||
134 | public function testGetIdentifier() |
|
135 | { |
|
@@ 134-149 (lines=16) @@ | ||
131 | $this->assertSame('profile', $grandChildScope->getScopeIdentifier()); |
|
132 | } |
|
133 | ||
134 | public function testGetIdentifier() |
|
135 | { |
|
136 | $manager = new Manager(); |
|
137 | ||
138 | $resource = new Item(['name' => 'Larry Ullman'], function () { |
|
139 | }); |
|
140 | ||
141 | $scope = new Scope($manager, $resource, 'book'); |
|
142 | $this->assertSame('book', $scope->getIdentifier()); |
|
143 | ||
144 | $childScope = $scope->embedChildScope('author', $resource); |
|
145 | $this->assertSame('book.author', $childScope->getIdentifier()); |
|
146 | ||
147 | $grandChildScope = $childScope->embedChildScope('profile', $resource); |
|
148 | $this->assertSame('book.author.profile', $grandChildScope->getIdentifier()); |
|
149 | } |
|
150 | ||
151 | public function testGetParentScopes() |
|
152 | { |