adds tests DB profiling
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 1 Sep 2015 13:18:59 +0000 (15:18 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 2 Sep 2015 12:05:17 +0000 (14:05 +0200)
activate db profiling by adding

'profiler' => true,

to section 'database' and

 'profiler' =>
array(
    'queryProfiles' => TRUE,
    'queryProfilesDetails' => TRUE,
)

to your config.inc.php

Change-Id: I4e28c99fb3e8a29c4302f51dff1ff053bdbdbced
Reviewed-on: http://gerrit.tine20.com/customers/2155
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/TestCase.php
tine20/Tinebase/Core.php

index 0e7c4fb..9f7f1f2 100644 (file)
@@ -112,6 +112,16 @@ abstract class TestCase extends PHPUnit_Framework_TestCase
         }
         
         Tinebase_Cache_PerRequest::getInstance()->resetCache();
+
+
+    }
+
+    /**
+     * tear down after test class
+     */
+    public static function tearDownAfterClass()
+    {
+        Tinebase_Core::getDbProfiling();
     }
     
     /**
index 12e3d51..1e7c9a5 100644 (file)
@@ -1052,6 +1052,7 @@ class Tinebase_Core
                         $data['longestQuery'] = $profile->getQuery();
                     }
                 }
+                $profiler->clear();
             }
         }