Skip to content

Commit

Permalink
Improved error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Apr 15, 2014
1 parent bdcf804 commit 8bd377f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Doctrine/ACLMetadataLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ACLMetadataLoader
public function registerRoleClass($class, $shortName)
{
if (! is_subclass_of($class, 'MyCLabs\ACL\Model\Role')) {
throw new \InvalidArgumentException('The given class doesn\'t extend MyCLabs\ACL\Model\Role');
throw new \InvalidArgumentException(sprintf('%s doesn\'t extend MyCLabs\ACL\Model\Role', $class));
}

$this->roles[$shortName] = $class;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Doctrine/ACLMetadataLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testRegisterRoleClass()

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The given class doesn't extend MyCLabs\ACL\Model\Role
* @expectedExceptionMessage foo doesn't extend MyCLabs\ACL\Model\Role
*/
public function testRegisterInvalidRoleClass()
{
Expand Down

0 comments on commit 8bd377f

Please sign in to comment.