diff options
-rw-r--r-- | Tests/Acl/Dbal/AclProviderTest.php | 7 | ||||
-rw-r--r-- | Tests/Acl/Dbal/MutableAclProviderTest.php | 7 | ||||
-rw-r--r-- | Tests/Core/Encoder/BCryptPasswordEncoderTest.php | 17 |
3 files changed, 12 insertions, 19 deletions
diff --git a/Tests/Acl/Dbal/AclProviderTest.php b/Tests/Acl/Dbal/AclProviderTest.php index 7ca493f..afbcb56 100644 --- a/Tests/Acl/Dbal/AclProviderTest.php +++ b/Tests/Acl/Dbal/AclProviderTest.php @@ -17,6 +17,9 @@ use Symfony\Component\Security\Acl\Domain\ObjectIdentity; use Symfony\Component\Security\Acl\Dbal\Schema; use Doctrine\DBAL\DriverManager; +/** + * @requires extension pdo_sqlite + */ class AclProviderTest extends \PHPUnit_Framework_TestCase { protected $con; @@ -141,10 +144,6 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { - self::markTestSkipped('This test requires SQLite support in your environment'); - } - $this->con = DriverManager::getConnection(array( 'driver' => 'pdo_sqlite', 'memory' => true, diff --git a/Tests/Acl/Dbal/MutableAclProviderTest.php b/Tests/Acl/Dbal/MutableAclProviderTest.php index 00500f8..3213406 100644 --- a/Tests/Acl/Dbal/MutableAclProviderTest.php +++ b/Tests/Acl/Dbal/MutableAclProviderTest.php @@ -27,6 +27,9 @@ use Symfony\Component\Security\Acl\Dbal\Schema; use Doctrine\DBAL\DriverManager; use Symfony\Component\Security\Acl\Domain\ObjectIdentity; +/** + * @requires extension pdo_sqlite + */ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase { protected $con; @@ -483,10 +486,6 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { - self::markTestSkipped('This test requires SQLite support in your environment'); - } - $this->con = DriverManager::getConnection(array( 'driver' => 'pdo_sqlite', 'memory' => true, diff --git a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php index 3f8ba86..076d954 100644 --- a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php +++ b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php @@ -45,32 +45,27 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase } } + /** + * @requires PHP 5.3.7 + */ public function testResultLength() { - $this->skipIfPhpVersionIsNotSupported(); - $encoder = new BCryptPasswordEncoder(self::VALID_COST); $result = $encoder->encodePassword(self::PASSWORD, null); $this->assertEquals(60, strlen($result)); } + /** + * @requires PHP 5.3.7 + */ public function testValidation() { - $this->skipIfPhpVersionIsNotSupported(); - $encoder = new BCryptPasswordEncoder(self::VALID_COST); $result = $encoder->encodePassword(self::PASSWORD, null); $this->assertTrue($encoder->isPasswordValid($result, self::PASSWORD, null)); $this->assertFalse($encoder->isPasswordValid($result, 'anotherPassword', null)); } - private function skipIfPhpVersionIsNotSupported() - { - if (PHP_VERSION_ID < 50307) { - $this->markTestSkipped('Requires PHP >= 5.3.7'); - } - } - /** * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException */ |