/** * @covers ::add */ public function testAdd() { $mockdb = new \TMT\MockDB(); $mockdb->expectPrepare("INSERT INTO notificationTypes (guid, name, resource, verb) VALUES(:guid, :name, :resource, :verb)"); $mockdb->expectExecute(array(":guid" => "guid1", ":name" => "type1", ":resource" => "resguid1", ":verb" => "read")); $accessor = new NotificationType($mockdb); $accessor->setGuidCreator(new MockGuidCreator("guid1")); $accessor->add(new \TMT\model\NotificationType(array("name" => "type1", "resource" => "resguid1", "verb" => "read"))); $mockdb->verify(); }