[Security] cleaned up opt-in to benchmark test

This commit is contained in:
Kris Wallsmith 2011-03-06 19:36:41 +01:00
parent 8438493a63
commit 2d1d2ba893
2 changed files with 25 additions and 20 deletions

View File

@ -18,6 +18,12 @@
</testsuite>
</testsuites>
<groups>
<exclude>
<group>benchmark</group>
</exclude>
</groups>
<filter>
<whitelist>
<directory>./src/Symfony/</directory>

View File

@ -17,6 +17,9 @@ use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use Symfony\Component\Security\Acl\Dbal\Schema;
use Doctrine\DBAL\DriverManager;
/**
* @group benchmark
*/
class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
{
protected $con;
@ -26,9 +29,24 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
protected $insertOidStmt;
protected $insertEntryStmt;
protected function setUp()
{
$this->con = DriverManager::getConnection(array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'user' => 'root',
'dbname' => 'testdb',
));
}
protected function tearDown()
{
$this->con = null;
}
public function testFindAcls()
{
// $this->generateTestData();
// $this->generateTestData();
// get some random test object identities from the database
$oids = array();
@ -45,25 +63,6 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
echo "Total Time: ".$time."s\n";
}
protected function setUp()
{
// comment the following line, and run only this test, if you need to benchmark
$this->markTestSkipped();
$this->con = DriverManager::getConnection(array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'user' => 'root',
'dbname' => 'testdb',
));
}
protected function tearDown()
{
$this->con = null;
}
/**
* This generates a huge amount of test data to be used mainly for benchmarking
* purposes, not so much for testing. That's why it's not called by default.