File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ public function testCanLoadTwoCellsWithSameShortName()
321321 $ this ->assertNotSame ($ cell1 , $ cell2 );
322322 }
323323
324- public function testDefineTwice ()
324+ public function testDefineSameAliasTwiceWithDifferentClasses ()
325325 {
326326 $ this ->expectException (InvalidArgumentException::class);
327327 $ this ->expectExceptionMessage (
@@ -340,6 +340,24 @@ public function testDefineTwice()
340340 );
341341 }
342342
343+ public function testDefineSameAliasAndSameClassTwice ()
344+ {
345+ Factories::define (
346+ 'models ' ,
347+ 'CodeIgniter\Shield\Models\UserModel ' ,
348+ UserModel::class
349+ );
350+ Factories::define (
351+ 'models ' ,
352+ 'CodeIgniter\Shield\Models\UserModel ' ,
353+ UserModel::class
354+ );
355+
356+ $ model = model ('CodeIgniter\Shield\Models\UserModel ' );
357+
358+ $ this ->assertInstanceOf (UserModel::class, $ model );
359+ }
360+
343361 public function testDefineNonExistentClass ()
344362 {
345363 $ this ->expectException (InvalidArgumentException::class);
You can’t perform that action at this time.
0 commit comments