diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-10-12 11:03:54 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-10-12 11:06:32 +0200 |
commit | 01c92f979f9a7b83457045bc562098604adbd454 (patch) | |
tree | 8d0a89cf09b828e891b9dbcbed478e6f541f2623 | |
parent | 3f3ab8f6b0a8ca0d84bdcfb9160692d82fcd7b7a (diff) | |
download | symfony-security-01c92f979f9a7b83457045bc562098604adbd454.zip symfony-security-01c92f979f9a7b83457045bc562098604adbd454.tar.gz symfony-security-01c92f979f9a7b83457045bc562098604adbd454.tar.bz2 |
[ci] Fix tests requirements
-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 */ |