public function testAddTableWithoutQueryParameterCreatesSelectWildcardAll() { $fixtureTableName = "foo"; $adapterMock = $this->getMock('Zend_Test_DbAdapter'); $selectMock = $this->getMock('Zend_Db_Select', array(), array($adapterMock)); $adapterMock->expects($this->once())->method('select')->will($this->returnValue($selectMock)); $this->decorateConnectionGetConnectionWith($adapterMock); $selectMock->expects($this->once())->method('from')->with($fixtureTableName, Zend_Db_Select::SQL_WILDCARD); $selectMock->expects($this->once())->method('__toString')->will($this->returnValue('SELECT * FOM foo')); $queryDataSet = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet($this->connectionMock); $queryDataSet->addTable('foo'); }
public function testConsrtuctWithId() { $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet($this->getConnection()); $ds->addTable('zfbugs', 'SELECT * FROM zfbugs'); }
public function testDeleteProfileByProfileSuccess() { $profileFactory = new Application_Factory_ProfileModel(); $this->profileTable->deleteProfile($profileFactory->createService(['id' => 1])); $currentDate = new DateTime('2015-07-16'); $current = $currentDate->format('Y-m-d'); $expected = $this->createArrayDataSet(['profile' => [['id' => 2, 'fullname' => 'Quang B', 'dob' => $current, 'email' => '*****@*****.**'], ['id' => 3, 'fullname' => 'Quang C', 'dob' => $current, 'email' => '*****@*****.**']]]); $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet($this->getConnection()); $ds->addTable('profile', "SELECT * FROM PROFILE"); $this->assertDataSetsEqual($expected, $ds); }