public function testDelete_dispatchesDeleteCommand() { $serverMock = $this->getServerMock(['dispatchCommand']); $serverMock->expects($this->once())->method('dispatchCommand')->with($this->callback(function (CommandInterface $command) { return $command->getCommandLine() === sprintf('%s %s', CommandInterface::COMMAND_DELETE, self::TEST_ID); }))->willReturn($this->_getResponseOathMock()); $job = new Job(self::TEST_ID, null, $serverMock); $job->delete(); $this->assertEquals(Job::STATE_DELETED, $job->getState()); }
/** * @return $this */ public function delete() { $this->job->delete(); return $this; }