Skip to content

Commit

Permalink
Merge pull request #48 from stof/skip_tests
Browse files Browse the repository at this point in the history
Added some check to skip tests when dev dependencies are missing
  • Loading branch information
asm89 committed Jun 29, 2012
2 parents 44d9e81 + b891b67 commit 3ef1121
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Tests/Security/Core/User/EntityUserProviderTest.php
Expand Up @@ -16,6 +16,13 @@

class EntityUserProviderTest extends \PHPUnit_Framework_Testcase
{
protected function setUp()
{
if (!class_exists('Doctrine\ORM\EntityManager')) {
$this->markTestSkipped('The Doctrine ORM is not available');
}
}

/**
* @expectedException RuntimeException
* @expectedExceptionMessage No property defined for entity for resource owner 'not_configured'.
Expand Down
7 changes: 7 additions & 0 deletions Tests/Security/Core/User/FOSUBUserProviderTest.php
Expand Up @@ -16,6 +16,13 @@

class FOSUBUserProviderTest extends \PHPUnit_Framework_Testcase
{
protected function setUp()
{
if (!class_exists('FOS\UserBundle\Model\UserManagerInterface')) {
$this->markTestSkipped('FOSUserBundle is not available');
}
}

/**
* @expectedException RuntimeException
* @expectedExceptionMessage No property defined for entity for resource owner 'not_configured'.
Expand Down
6 changes: 3 additions & 3 deletions Tests/Security/Core/User/OAuthUserProviderTest.php
Expand Up @@ -13,7 +13,7 @@

use HWI\Bundle\OAuthBundle\Security\Core\User\OAuthUser,
HWI\Bundle\OAuthBundle\Security\Core\User\OAuthUserProvider,
HWI\Bundle\OAuthBundle\Tests\Fixtures\User;
Symfony\Component\Security\Core\User\User;

class OAuthUserProviderTest extends \PHPUnit_Framework_Testcase
{
Expand Down Expand Up @@ -41,11 +41,11 @@ public function testRefreshUser()

/**
* @expectedException Symfony\Component\Security\Core\Exception\UnsupportedUserException
* @expectedExceptionMessage Unsupported user class "HWI\Bundle\OAuthBundle\Tests\Fixtures\User"
* @expectedExceptionMessage Unsupported user class "Symfony\Component\Security\Core\User\User"
*/
public function testRefreshUserUnsupportedClass()
{
$user = new User;
$user = new User('asm89', 'foo');

$this->provider->refreshUser($user);
}
Expand Down

0 comments on commit 3ef1121

Please sign in to comment.