diff --git a/tests/Storm/Test/LoaderVolatileTest.php b/tests/Storm/Test/LoaderVolatileTest.php index aac0b8979cdb1fe329b890ee5a36661813a89c5f..a1cb12eac6cf7f1ba23ba8d15bed30e444f93a82 100644 --- a/tests/Storm/Test/LoaderVolatileTest.php +++ b/tests/Storm/Test/LoaderVolatileTest.php @@ -33,8 +33,8 @@ class Storm_Test_VolatileUser extends Storm_Model_Abstract { 'id_mouth' => null, 'brain_id' => null], - $_has_many = ['cats' => ['model' => 'Storm_Test_VolatileCat', - 'instance_of' => 'Storm_Test_VolatilePets', + $_has_many = ['cats' => ['model' => Storm_Test_VolatileCat::class, + 'instance_of' => Storm_Test_VolatilePets::class, 'dependents' => 'delete', 'role' => 'master']]; @@ -45,10 +45,10 @@ class Storm_Test_VolatileUser extends Storm_Model_Abstract { public function describeAssociationsOn($associations) { $associations - ->add(new Storm_Model_Association_HasOne('brain', ['model' => 'Storm_Test_VolatileBrain', + ->add(new Storm_Model_Association_HasOne('brain', ['model' => Storm_Test_VolatileBrain::class, 'referenced_in' => 'brain_id'])) - ->add(new Storm_Model_Association_HasOne('mouth', ['model' => 'Storm_Test_VolatileMouth', + ->add(new Storm_Model_Association_HasOne('mouth', ['model' => Storm_Test_VolatileMouth::class, 'referenced_in' => 'id_mouth'])); } } @@ -114,7 +114,7 @@ class Storm_Test_LoaderVolatileTest extends Storm_Test_ModelTestCase { 'option' => 'set', 'brain_id' => 2]); - $this->hubert_brain = $this->fixture('Storm_Test_VolatileBrain', + $this->hubert_brain = $this->fixture(Storm_Test_VolatileBrain::class, ['id' => 2, 'weight' => 155]); @@ -125,15 +125,15 @@ class Storm_Test_LoaderVolatileTest extends Storm_Test_ModelTestCase { 'level' => 'admin', 'foo' => 'snafu', 'cats' => [ - $this->fixture('Storm_Test_VolatileCat', + $this->fixture(Storm_Test_VolatileCat::class, ['id' => 3, 'name' => 'riri']), - $this->fixture('Storm_Test_VolatileCat', + $this->fixture(Storm_Test_VolatileCat::class, ['id' => 4, 'name' => 'fifi']), - $this->fixture('Storm_Test_VolatileCat', + $this->fixture(Storm_Test_VolatileCat::class, ['id' => 5, 'name' => 'loulou']), ] @@ -173,7 +173,7 @@ class Storm_Test_LoaderVolatileTest extends Storm_Test_ModelTestCase { /** @test */ public function changingAlbertBrainShouldUpdateItsReferenceInBrainId() { - $better_brain = $this->fixture('Storm_Test_VolatileBrain', ['id' => 3, + $better_brain = $this->fixture(Storm_Test_VolatileBrain::class, ['id' => 3, 'weight' => 150]); $this->albert->setBrain($better_brain); $this->assertEquals(3, $this->albert->getBrainId()); @@ -483,6 +483,17 @@ class Storm_Test_LoaderVolatileTest extends Storm_Test_ModelTestCase { } + + /** + * @expectedException Storm_Model_Exception + * @expectedExceptionMessage 'array given for login is empty' + * @test + **/ + public function findAllWithLoginEmptyArrayShouldRaiseEmptyArrayException() { + Storm_Test_VolatileUser::findAll(['login'=> []]); + } + + /** @test */ public function findAllInviteOrderByLoginNameDescShouldReturnMaxAndHubert() { $this->max->save();