public function testQueryProfiler_QueryBindWithParams() { $stmt = $this->_adapter->query("SELECT * FROM foo WHERE bar = ?", array(1234)); $qp = $this->_adapter->getProfiler()->getLastQueryProfile(); /* @var $qp Zend_Db_Profiler_Query */ $this->assertEquals(array(1 => 1234), $qp->getQueryParams()); $this->assertEquals("SELECT * FROM foo WHERE bar = ?", $qp->getQuery()); }
public function testResourceDbShouldContainTheOwnerCompany() { $request = $this->getRequest(); $request->setMethod('GET')->setGet(array('company' => 'Secogal')); $this->dispatch('/user/add'); $adapter = new Zend_Test_DbAdapter(); $resource = $adapter->query("SELECT * FROM company WHERE name ='{$request->company}'"); //TODO "secogal must config in the config.ini $this->assertCount($resource, "0"); $this->assertRedirectTo('/resource/error'); }