public function testDelete() { list($conn, $keygen, $query) = $this->getMocks(); $instance = new DraftRepository($conn, $keygen); $mockEntity = m::mock('Xpressengine\\Draft\\DraftEntity'); $mockEntity->shouldReceive('get')->with('id')->andReturn('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'); $conn->shouldReceive('table')->andReturn($query); $query->shouldReceive('where')->once()->with('id', 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')->andReturnSelf(); $query->shouldReceive('delete')->once()->andReturn(1); $instance->delete($mockEntity); }
/** * 임시저장 데이터 삭제 * * @param DraftEntity $draft 임시저장 객체 * @return void */ public function remove(DraftEntity $draft) { $this->repo->delete($draft); }