示例#1
0
 public function testStats_dispatchesStatsCommand_returnsStats()
 {
     $serverMock = $this->getServerMock(['dispatchCommand']);
     $stats = ['some' => 'stats'];
     $response = new Response(Response::RESPONSE_OK, $stats, $serverMock);
     $responseOath = $this->_getResponseOathMock();
     $responseOath->expects($this->once())->method('invoke')->willReturn($response);
     $serverMock->expects($this->once())->method('dispatchCommand')->with($this->callback(function (CommandInterface $command) {
         return $command->getCommandLine() === sprintf('%s %s', CommandInterface::COMMAND_STATS_JOB, self::TEST_ID);
     }))->willReturn($responseOath);
     $job = new Job(self::TEST_ID, null, $serverMock);
     $jobStats = $job->stats();
     $this->assertEquals($stats, $jobStats);
 }
示例#2
0
文件: Job.php 项目: zwilias/qman
 /**
  * @return array
  */
 public function stats()
 {
     return $this->job->stats();
 }