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
166166
167167 public function getSpaces (): array
168168 {
169+ if (!count ($ this ->spaces )) {
170+ $ this ->setSchemaId (0 );
171+ }
172+
169173 return array_values ($ this ->spaces );
170174 }
171175
172176 public function hasSpace (string $ space ): bool
173177 {
178+ if (!count ($ this ->spaces )) {
179+ $ this ->setSchemaId (0 );
180+ }
181+
174182 return array_key_exists ($ this ->getClassSpace ($ space ), $ this ->spaceId );
175183 }
176184
Original file line number Diff line number Diff line change @@ -35,6 +35,16 @@ public function createMapper(
3535 return $ mapper ;
3636 }
3737
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+
3848 public function testClassBased ()
3949 {
4050 $ mapper = $ this ->createMapper ();
You can’t perform that action at this time.
0 commit comments