Forráskód Böngészése

[Security] cleaned up opt-in to benchmark test

Kris Wallsmith 14 éve
szülő
commit
2d1d2ba893

+ 6 - 0
phpunit.xml.dist

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

+ 19 - 20
tests/Symfony/Tests/Component/Security/Acl/Dbal/AclProviderBenchmarkTest.php

@@ -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.