/** * Ensures that setting the profiler does not affect whether the profiler is enabled. * * @return void */ public function testProfilerFactoryEnabledUnaffected() { require_once 'Zend/Db/Profiler/ProfilerCustom.php'; $profiler = new Zend_Db_Profiler_ProfilerCustom(); $profiler->setEnabled(true); $db = Zend_Db::factory('Static', array('dbname' => 'dummy', 'profiler' => $profiler)); $this->assertType('Zend_Db_Adapter_Abstract', $db, 'Expected object of type Zend_Db_Adapter_Abstract, got ' . get_class($db)); $profiler2 = $db->getProfiler(); $this->assertSame($profiler, $profiler2); $this->assertTrue($profiler->getEnabled()); }
/** * Ensures that setting the profiler does not affect whether the profiler is enabled. * * @return void */ public function testProfilerFactoryEnabledUnaffected() { $profiler = new \Zend_Db_Profiler_ProfilerCustom(); $profiler->setEnabled(true); $db = Db\DB::factory('Static', array('dbname' => 'dummy', 'profiler' => $profiler)); $this->assertInstanceOf('Zend_Db_Adapter_Abstract', $db, 'Expected object of type Zend_Db_Adapter_Abstract, got ' . get_class($db)); $profiler2 = $db->getProfiler(); $this->assertSame($profiler, $profiler2); $this->assertTrue($profiler->getEnabled()); }