public function testGetParentIdsByChild() { $childId = 234; $typeId = 4; $fetchedData = [['product_id' => 55], ['product_id' => 66]]; $result = [55, 66]; // method flow $this->prepareReadAdapter(); $this->dbSelect->expects($this->once())->method('from')->will($this->returnValue($this->dbSelect)); $this->dbSelect->expects($this->any())->method('where')->will($this->returnValue($this->dbSelect)); $this->readAdapter->expects($this->once())->method('fetchAll')->with($this->dbSelect)->will($this->returnValue($fetchedData)); $this->assertEquals($result, $this->model->getParentIdsByChild($childId, $typeId)); }