File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -166,11 +166,19 @@ public function getSpace(object|int|string $id): Space
166
166
167
167
public function getSpaces (): array
168
168
{
169
+ if (!count ($ this ->spaces )) {
170
+ $ this ->setSchemaId (0 );
171
+ }
172
+
169
173
return array_values ($ this ->spaces );
170
174
}
171
175
172
176
public function hasSpace (string $ space ): bool
173
177
{
178
+ if (!count ($ this ->spaces )) {
179
+ $ this ->setSchemaId (0 );
180
+ }
181
+
174
182
return array_key_exists ($ this ->getClassSpace ($ space ), $ this ->spaceId );
175
183
}
176
184
Original file line number Diff line number Diff line change @@ -35,6 +35,16 @@ public function createMapper(
35
35
return $ mapper ;
36
36
}
37
37
38
+ public function testUninitializedSpacePresent ()
39
+ {
40
+ $ this ->assertTrue ($ this ->createMapper (dropUserSpaces:false )->hasSpace ('_space ' ));
41
+ }
42
+
43
+ public function testUninitializedSpaceList ()
44
+ {
45
+ $ this ->assertNotCount (0 , $ this ->createMapper (dropUserSpaces:false )->getSpaces ());
46
+ }
47
+
38
48
public function testClassBased ()
39
49
{
40
50
$ mapper = $ this ->createMapper ();
You can’t perform that action at this time.
0 commit comments