Skip to content

Commit

Permalink
Merge branch '5.7' of github.com:laravel/framework into 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 11, 2018
2 parents 51aa60b + d2dc1f3 commit 536a024
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/Auth/AuthAccessGateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,30 @@ public function test_for_user_method_attaches_a_new_user_to_a_new_gate_instance(
$this->assertTrue($gate->forUser((object) ['id' => 2])->check('foo'));
}

/**
* @dataProvider notCallableDataProvider
* @expectedException \InvalidArgumentException
*/
public function test_define_second_parametter_should_be_string_or_callable($callback)
{
$gate = $this->getBasicGate();

$gate->define('foo', $callback);
}

/**
* @return array
*/
public function notCallableDataProvider()
{
return [
[1],
[new \stdClass()],
[[]],
[1.1],
];
}

/**
* @expectedException \Illuminate\Auth\Access\AuthorizationException
* @expectedExceptionMessage You are not an admin.
Expand Down

0 comments on commit 536a024

Please sign in to comment.