コード例 #1
0
 public function setUp()
 {
     TaoPhpUnitTestRunner::initTest();
     $this->service = TestRunnerService::singleton();
     $this->storageMock = $this->getMockBuilder('tao_models_classes_service_FileStorage')->disableOriginalConstructor()->setMethods(array('getDirectoryById'))->getMock();
     $ref = new \ReflectionProperty('tao_models_classes_service_FileStorage', 'instance');
     $ref->setAccessible(true);
     $ref->setValue(null, $this->storageMock);
     $this->directoryMock = $this->getMockBuilder('tao_models_classes_service_StorageDirectory')->disableOriginalConstructor()->setMethods(array('getPath'))->getMock();
 }
コード例 #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');
     }
 }