php - symfony & phpunit : $client->getProfile()->getCollector('db')->getQueryCount() returning always same result -


in tests phpunit , symfony2, trying assess query count, following examples in symfony doc.

for strange reason, query count same, whatever page loaded.

can me figure out why ?

my code :

/**  * @dataprovider urlprovider  * @param $url  */ public function testpageissuccessful($url) {     $client = static::createclient(array(), array(             'php_auth_user' => 'superadmin',             'php_auth_pw'   => '587010',         ));     $client->enableprofiler();     $client->followredirects();     $client->request('get', $url);     var_dump($url);     $this->assertequals(200, $client->getresponse()->getstatuscode());     $querycount = $client->getprofile()->getcollector('db')->getquerycount();     var_dump('q: ' . $querycount);     $this->assertlessthan(60,$querycount); 

}

the previous code dumping following, constant number of 18 queries (which not reflect reality) :

.string(44) "/foodanalytics/user_supplier/change_supplier" string(5) "q: 18" .string(10) "/dashboard" string(5) "q: 18" .string(34) "/user/associate/display_associates" string(5) "q: 18" .string(46) "/job/application/display_employer_applications" string(5) "q: 18" ... 


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -