Skip to content

Commit 2d1d2ba

Browse files
committed
[Security] cleaned up opt-in to benchmark test
1 parent 8438493 commit 2d1d2ba

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

phpunit.xml.dist

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
</testsuite>
1919
</testsuites>
2020

21+
<groups>
22+
<exclude>
23+
<group>benchmark</group>
24+
</exclude>
25+
</groups>
26+
2127
<filter>
2228
<whitelist>
2329
<directory>./src/Symfony/</directory>

tests/Symfony/Tests/Component/Security/Acl/Dbal/AclProviderBenchmarkTest.php

+19-20
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Symfony\Component\Security\Acl\Dbal\Schema;
1818
use Doctrine\DBAL\DriverManager;
1919

20+
/**
21+
* @group benchmark
22+
*/
2023
class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
2124
{
2225
protected $con;
@@ -26,9 +29,24 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
2629
protected $insertOidStmt;
2730
protected $insertEntryStmt;
2831

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+
2947
public function testFindAcls()
3048
{
31-
// $this->generateTestData();
49+
// $this->generateTestData();
3250

3351
// get some random test object identities from the database
3452
$oids = array();
@@ -45,25 +63,6 @@ public function testFindAcls()
4563
echo "Total Time: ".$time."s\n";
4664
}
4765

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-
6766
/**
6867
* This generates a huge amount of test data to be used mainly for benchmarking
6968
* purposes, not so much for testing. That's why it's not called by default.

0 commit comments

Comments
 (0)