/** * Test query counter. * * @return void */ public function testQueryCount() { R::nuke(); R::store(R::dispense('bean')); R::resetQueryCount(); asrt(R::getQueryCount(), 0); R::findOne('bean'); asrt(R::getQueryCount(), 1); R::resetQueryCount(); asrt(R::getQueryCount(), 0); R::findOne('bean'); R::findOne('bean'); R::findOne('bean'); asrt(R::getQueryCount(), 0); R::store(R::dispense('bean2')); R::resetQueryCount(); R::findOne('bean'); R::findOne('bean2'); asrt(R::getQueryCount(), 2); R::resetQueryCount(); R::findOne('bean', ' id < 100'); R::findOne('bean', ' id < 101'); R::findOne('bean', ' id < 102'); R::findOne('bean', ' id < 103'); asrt(R::getQueryCount(), 4); R::findOne('bean', ' id < 100'); R::findOne('bean', ' id < 101'); R::findOne('bean', ' id < 102'); R::findOne('bean', ' id < 103'); asrt(R::getQueryCount(), 4); R::findOne('bean', ' id < 104'); asrt(R::getQueryCount(), 5); }