From c1fa72d84ed80a545174d81f47b3e902eeaa6794 Mon Sep 17 00:00:00 2001 From: Bader Date: Mon, 30 Mar 2020 05:34:06 +0300 Subject: [PATCH] Update KabsaTest.php --- tests/KabsaTest.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/KabsaTest.php b/tests/KabsaTest.php index 6a1a6b4..be4be9e 100755 --- a/tests/KabsaTest.php +++ b/tests/KabsaTest.php @@ -39,6 +39,50 @@ public function first_test() $this->assertEquals('admin', Role::first()->label); } + /** @test * */ + public function static_var() + { + $this->assertEquals([ + ['label' => 'admin'], + ['label' => 'manager'], + ['label' => 'user'] + ], Role::all()->toArray()); + + + $this->assertEquals([ + ['label' => 'admin'], + ['label' => 'manager'], + ['label' => 'user'] + ], Role::$kabsaCollection->toArray()); + + + Role::$kabsaCollection = collect([['static']]); + + //one + $this->assertEquals([ + ['static'] + ], Role::all()->toArray()); + + //two + $this->assertEquals([ + ['static'] + ], Role::all()->toArray()); + + Role::$kabsaCollection = []; + + $this->assertEquals([ + ['label' => 'admin'], + ['label' => 'manager'], + ['label' => 'user'] + ], Role::all()->toArray()); + + $this->assertEquals([ + ['label' => 'admin'], + ['label' => 'manager'], + ['label' => 'user'] + ], Role::$kabsaCollection->toArray()); + } + /** * Define environment setup. *