/** * @covers ::getAll */ public function testGetAll() { $mockdb = new \TMT\MockDB(); $mockdb->expectPrepare("SELECT * FROM notificationTypes"); $mockdb->expectExecute(); $mockdb->setReturnData(array((object) array("guid" => "guid1", "name" => "type1", "resource" => "resguid1", "verb" => "read"), (object) array("guid" => "guid2", "name" => "type2", "resource" => null, "verb" => null))); $expected = array(new \TMT\model\NotificationType(array("guid" => "guid1", "name" => "type1", "resource" => "resguid1", "verb" => "read")), new \TMT\model\NotificationType(array("guid" => "guid2", "name" => "type2", "resource" => null, "verb" => null))); $accessor = new NotificationType($mockdb); $actual = $accessor->getAll(); $this->assertEquals($expected, $actual); $mockdb->verify(); }