/** * test delete * * @return void */ public function testDelete() { $conn = $this->conn; $repo = new DocumentRepository($conn); $doc = $this->getDocumentEntity(); $config = $this->getConfigEntity(); $config->shouldReceive('get')->with('division')->andReturn(true); $config->shouldReceive('get')->with('instanceId')->andReturn('instanceId'); $this->query->shouldReceive('delete')->andReturn(1); $this->query->shouldReceive('where')->andReturn($this->query); $result = $repo->delete($doc, $config); $this->assertEquals(1, $result); $result = $repo->deleteByInstanceId('instanceId'); $this->assertEquals(1, $result); }