[SecurityBundle] Skip SetAclCommandTest when sqlite is not available

This commit is contained in:
Nicolas Grekas 2015-08-27 11:23:04 +02:00
parent 283ba52142
commit 95961a5aae

View File

@ -30,6 +30,23 @@ class SetAclCommandTest extends WebTestCase
const OBJECT_CLASS = 'Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AclBundle\Entity\Car'; const OBJECT_CLASS = 'Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AclBundle\Entity\Car';
const SECURITY_CLASS = 'Symfony\Component\Security\Core\User\User'; const SECURITY_CLASS = 'Symfony\Component\Security\Core\User\User';
protected function setUp()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment');
}
parent::setUp();
$this->deleteTmpDir('Acl');
}
protected function tearDown()
{
parent::tearDown();
$this->deleteTmpDir('Acl');
}
public function testSetAclUser() public function testSetAclUser()
{ {
$objectId = 1; $objectId = 1;
@ -151,20 +168,6 @@ class SetAclCommandTest extends WebTestCase
$this->assertTrue($acl2->isGranted($permissionMap->getMasks($grantedPermission, null), array($roleSecurityIdentity))); $this->assertTrue($acl2->isGranted($permissionMap->getMasks($grantedPermission, null), array($roleSecurityIdentity)));
} }
protected function setUp()
{
parent::setUp();
$this->deleteTmpDir('Acl');
}
protected function tearDown()
{
parent::tearDown();
$this->deleteTmpDir('Acl');
}
private function getApplication() private function getApplication()
{ {
$kernel = $this->createKernel(array('test_case' => 'Acl')); $kernel = $this->createKernel(array('test_case' => 'Acl'));