예제 #1
0
 public function testGetAttributesByType()
 {
     $typeId = 4;
     $result = [100, 200, 300, 400];
     $this->prepareReadAdapter();
     $this->dbSelect->expects($this->once())->method('from')->will($this->returnValue($this->dbSelect));
     $this->dbSelect->expects($this->atLeastOnce())->method('where')->with('link_type_id = ?', $typeId)->will($this->returnValue($this->dbSelect));
     $this->readAdapter->expects($this->once())->method('fetchAll')->will($this->returnValue($result));
     $this->assertEquals($result, $this->model->getAttributesByType($typeId));
 }