File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ public function get($name)
4444 return $ this ->getMapper ($ name );
4545 }
4646
47+ public function drop ($ name )
48+ {
49+ if (array_key_exists ($ name , $ this ->mappers )) {
50+ unset($ this ->mappers [$ name ]);
51+ }
52+ }
53+
4754 public function getMapper ($ name )
4855 {
4956 if (array_key_exists ($ name , $ this ->mappers )) {
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ public function test()
1919 $ pool ->register ('test2 ' , $ mapper2 );
2020 $ this ->assertSame ($ pool ->get ('test2 ' ), $ mapper2 );
2121 $ this ->assertNotSame ($ pool ->get ('test2 ' ), $ mapper );
22+
23+ $ this ->assertCount (2 , $ pool ->getMappers ());
24+
25+ $ pool ->drop ('test ' );
26+ $ this ->assertCount (1 , $ pool ->getMappers ());
2227 }
2328
2429 public function testDynamic ()
You can’t perform that action at this time.
0 commit comments