public function testDelete() { // ARRANGE $expectedSql = "DELETE FROM `countries` WHERE `countries`.`id` = '123'"; // ACT $this->tableGateway->delete('123'); // ASSERT $this->assertTableGatewayLastSqlDelete($expectedSql); }
public function testQueriesWithMultipleResults() { // ARRANGE $this->exampleTableGateway->expects($this->once())->method('findBySomeField')->will($this->returnValue(array($this->getSampleData()))); // ACT $result = $this->exampleMapper->getSomeResults(); /* @var ExampleModel[] $result */ // ASSERT $this->assertInternalType('array', $result); $this->assertInstanceOf(ExampleModel::class, $result[0]); $this->assertEquals('234', $result[0]->id); $this->assertEquals('Country Name', $result[0]->name); }
/** * @return array */ public function getSomeResults() { $rowset = $this->tableGateway->findBySomeField('asdf'); return $this->buildModelsFromResultSet($rowset); }