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