コード例 #1
0
 public function testGetPreviousWithConfig()
 {
     $compilationId = "MyCompilationID#4";
     $this->directoryMock->expects($this->once())->method('getPath')->willReturn(dirname(__FILE__) . '/../sample/withConfig/');
     $this->storageMock->expects($this->once())->method('getDirectoryById')->with($compilationId)->willReturn($this->directoryMock);
     $previous = $this->service->getPrevious($compilationId);
     $this->assertInternalType('boolean', $previous, __('Get previous should return a boolean'));
     $this->assertTrue($previous, __('Previous should be true'));
 }
コード例 #2
0
 public function previous()
 {
     $itemKeys = array_keys(TestRunnerService::singleton()->getItemData($this->compilationId));
     if (isset($itemKeys[$this->current - 1]) && TestRunnerService::singleton()->getPrevious($this->compilationId)) {
         $this->current--;
         if (!isset($this->itemExecutions[$this->current])) {
             $this->itemExecutions[$this->current] = array('itemIndex' => $itemKeys[$this->current], 'callId' => $this->testExecutionId . '_' . $this->current);
         }
     } else {
         throw new \common_Exception('previous called on first Item');
     }
 }