Skip to content

Commit

Permalink
Update KabsaTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BSN4 authored Aug 2, 2021
1 parent b5a8a70 commit 85efef5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/KabsaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ public function static_var()
['label' => 'user']
], Role::all()->toArray());

$collection = $this->getOrSetProperty(Role::class, 'kabsaCollection');
$collection = $this->getOrSetProperty(new Role(), 'kabsaCollection');

$this->assertEquals([
['label' => 'admin'],
['label' => 'manager'],
['label' => 'user']
], $collection->toArray());


//set something else
$this->getOrSetProperty(Role::class, 'kabsaCollection', collect([['static']]));
$this->getOrSetProperty(new Role(), 'kabsaCollection', collect([['static']]));

//one
$this->assertEquals([
Expand All @@ -87,17 +86,16 @@ public function static_var()
['static']
], Role::all()->toArray());

$this->getOrSetProperty(Role::class, 'kabsaCollection', null);
$this->getOrSetProperty(new Role(), 'kabsaCollection', null);

$this->assertEquals([
['label' => 'admin'],
['label' => 'manager'],
['label' => 'user']
], Role::all()->toArray());

$collection = $this->getOrSetProperty(Role::class, 'kabsaCollection');


$collection = $this->getOrSetProperty(new Role(), 'kabsaCollection');

$this->assertEquals([
['label' => 'admin'],
['label' => 'manager'],
Expand Down Expand Up @@ -178,4 +176,4 @@ public function role()
{
return $this->belongsToKabsaRow(Role::class, 'role_label', 'label');
}
}
}

0 comments on commit 85efef5

Please sign in to comment.