17
17
use Symfony \Component \Security \Acl \Dbal \Schema ;
18
18
use Doctrine \DBAL \DriverManager ;
19
19
20
+ /**
21
+ * @group benchmark
22
+ */
20
23
class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
21
24
{
22
25
protected $ con ;
@@ -26,9 +29,24 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
26
29
protected $ insertOidStmt ;
27
30
protected $ insertEntryStmt ;
28
31
32
+ protected function setUp ()
33
+ {
34
+ $ this ->con = DriverManager::getConnection (array (
35
+ 'driver ' => 'pdo_mysql ' ,
36
+ 'host ' => 'localhost ' ,
37
+ 'user ' => 'root ' ,
38
+ 'dbname ' => 'testdb ' ,
39
+ ));
40
+ }
41
+
42
+ protected function tearDown ()
43
+ {
44
+ $ this ->con = null ;
45
+ }
46
+
29
47
public function testFindAcls ()
30
48
{
31
- // $this->generateTestData();
49
+ // $this->generateTestData();
32
50
33
51
// get some random test object identities from the database
34
52
$ oids = array ();
@@ -45,25 +63,6 @@ public function testFindAcls()
45
63
echo "Total Time: " .$ time ."s \n" ;
46
64
}
47
65
48
-
49
- protected function setUp ()
50
- {
51
- // comment the following line, and run only this test, if you need to benchmark
52
- $ this ->markTestSkipped ();
53
-
54
- $ this ->con = DriverManager::getConnection (array (
55
- 'driver ' => 'pdo_mysql ' ,
56
- 'host ' => 'localhost ' ,
57
- 'user ' => 'root ' ,
58
- 'dbname ' => 'testdb ' ,
59
- ));
60
- }
61
-
62
- protected function tearDown ()
63
- {
64
- $ this ->con = null ;
65
- }
66
-
67
66
/**
68
67
* This generates a huge amount of test data to be used mainly for benchmarking
69
68
* purposes, not so much for testing. That's why it's not called by default.
0 commit comments