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