@@ -46,6 +46,14 @@ public function testClassBased()
4646 $ mapper ->registerClass (TypedConstructor::class);
4747 $ this ->assertInstanceOf (TypedConstructor::class, $ mapper ->findOne ('constructor ' ));
4848 $ this ->assertEquals ($ row , $ mapper ->findOne ('constructor ' ));
49+
50+ $ constructor = $ mapper ->findOne ('constructor ' );
51+
52+ $ mapper ->update ($ constructor , ['nick ' => 'space casting ' ]);
53+ $ this ->assertSame ($ constructor ->nick , 'space casting ' );
54+
55+ $ mapper ->delete ($ constructor );
56+ $ this ->assertNull ($ mapper ->findOne ('constructor ' ));
4957 }
5058
5159 public function testAttribute ()
@@ -490,14 +498,20 @@ public function testSpaces()
490498
491499 $ pool = new Pool (function () use ($ mapper ) {
492500 return $ mapper ;
501+ }, function ($ instance ) use ($ mapper ) {
502+ $ name = get_class ($ instance )::getSpaceName ();
503+ return "prefix. $ name " ;
493504 });
494505
495506 $ pool ->create ('first.array ' , ['nick ' => 'qwerty ' ]);
496- $ pool ->create ('second.constructor ' , ['nick ' => 'asdf ' ]);
507+ $ constructor = $ pool ->create ('second.constructor ' , ['nick ' => 'asdf ' ]);
497508
498509 $ changes = $ pool ->getChanges ();
499510 $ this ->assertCount (4 , $ changes );
500511 $ this ->assertSame ($ changes [0 ]->space , 'first.array ' );
501512 $ this ->assertSame ($ changes [2 ]->space , 'second.array ' );
513+
514+ // validate pool space casting
515+ $ pool ->update ($ constructor , ['nick ' => 'tester ' ]);
502516 }
503517}
0 commit comments