|
@@ -17,6 +17,9 @@ use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
|
|
use Symfony\Component\Security\Acl\Dbal\Schema;
|
|
use Symfony\Component\Security\Acl\Dbal\Schema;
|
|
use Doctrine\DBAL\DriverManager;
|
|
use Doctrine\DBAL\DriverManager;
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * @group benchmark
|
|
|
|
+ */
|
|
class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
|
|
class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
{
|
|
protected $con;
|
|
protected $con;
|
|
@@ -26,9 +29,24 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
|
|
protected $insertOidStmt;
|
|
protected $insertOidStmt;
|
|
protected $insertEntryStmt;
|
|
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()
|
|
public function testFindAcls()
|
|
{
|
|
{
|
|
-// $this->generateTestData();
|
|
|
|
|
|
+ // $this->generateTestData();
|
|
|
|
|
|
// get some random test object identities from the database
|
|
// get some random test object identities from the database
|
|
$oids = array();
|
|
$oids = array();
|
|
@@ -45,25 +63,6 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
|
|
echo "Total Time: ".$time."s\n";
|
|
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
|
|
* 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.
|
|
* purposes, not so much for testing. That's why it's not called by default.
|