Example #1
0
 protected function setUp()
 {
     $this->backEndUserBackup = $GLOBALS['BE_USER'];
     $this->getLanguageService()->includeLLFile('EXT:phpunit/Resources/Private/Language/locallang_backend.xlf');
     $subjectClassName = $this->createAccessibleProxy();
     $this->subject = new $subjectClassName();
     $this->request = new Tx_Phpunit_TestingDataContainer();
     $this->subject->injectRequest($this->request);
     $this->outputService = new Tx_Phpunit_Service_FakeOutputService();
     $this->subject->injectOutputService($this->outputService);
     $this->userSettingsService = new Tx_Phpunit_TestingDataContainer();
     $this->subject->injectUserSettingsService($this->userSettingsService);
     $this->testFinder = new Tx_Phpunit_Service_TestFinder();
     $this->extensionSettingsService = new Tx_Phpunit_TestingDataContainer();
     $this->testFinder->injectExtensionSettingsService($this->extensionSettingsService);
     $this->subject->injectTestFinder($this->testFinder);
     $this->testCaseService = new Tx_Phpunit_Service_TestCaseService();
     $this->testCaseService->injectUserSettingsService($this->userSettingsService);
     $this->subject->injectTestCaseService($this->testCaseService);
     $this->progressBarViewHelper = $this->getMock('Tx_Phpunit_ViewHelpers_ProgressBarViewHelper');
     GeneralUtility::addInstance('Tx_Phpunit_ViewHelpers_ProgressBarViewHelper', $this->progressBarViewHelper);
     $this->documentTemplate = $this->getMock('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate', array('startPage'));
     GeneralUtility::addInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate', $this->documentTemplate);
     $this->singletonInstances = GeneralUtility::getSingletonInstances();
 }
 public function setUp()
 {
     $this->backEndUserBackup = $GLOBALS['BE_USER'];
     $fixtureClassName = $this->createAccessibleProxy();
     $this->fixture = new $fixtureClassName();
     $this->request = new Tx_Phpunit_TestingDataContainer();
     $this->fixture->injectRequest($this->request);
     $this->outputService = new Tx_Phpunit_Service_FakeOutputService();
     $this->fixture->injectOutputService($this->outputService);
     $this->userSettingsService = new Tx_Phpunit_TestingDataContainer();
     $this->fixture->injectUserSettingsService($this->userSettingsService);
     $this->testFinder = new Tx_Phpunit_Service_TestFinder();
     $this->extensionSettingsService = new Tx_Phpunit_TestingDataContainer();
     $this->testFinder->injectExtensionSettingsService($this->extensionSettingsService);
     $this->fixture->injectTestFinder($this->testFinder);
     $this->testCaseService = new Tx_Phpunit_Service_TestCaseService();
     $this->testCaseService->injectUserSettingsService($this->userSettingsService);
     $this->fixture->injectTestCaseService($this->testCaseService);
     $this->progressBarViewHelper = $this->getMock('Tx_Phpunit_ViewHelpers_ProgressBarViewHelper');
     t3lib_div::addInstance('Tx_Phpunit_ViewHelpers_ProgressBarViewHelper', $this->progressBarViewHelper);
     $this->bigDocumentTemplate = $this->getMock('bigDoc', array('startPage'));
     if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) < 6000000) {
         t3lib_div::addInstance('bigDoc', $this->bigDocumentTemplate);
     } else {
         t3lib_div::addInstance('TYPO3\\CMS\\Backend\\Template\\BigDocumentTemplate', $this->bigDocumentTemplate);
     }
 }
Example #3
0
 /**
  * Recursively finds all test case files in the directory $directory.
  *
  * @param string $directory
  *        the absolute path of the directory in which to look for test cases,
  *        must not be empty
  *
  * @return array<array><string>
  *         files names of the test cases in the directory $dir and all
  *         its subdirectories relative to $dir, will be empty if no
  *         test cases have been found
  */
 protected function findTestCasesInDir($directory)
 {
     if (!is_dir($directory)) {
         return array();
     }
     $testCaseFileNames = $this->testCaseService->findTestCaseFilesInDirectory($directory);
     $extensionsArr = array();
     if (!empty($testCaseFileNames)) {
         $extensionsArr[$directory] = $testCaseFileNames;
     }
     return $extensionsArr;
 }
 /**
  * @test
  *
  * @dataProvider invalidTestCaseClassNameDataProvider
  *
  * @param string $className
  */
 public function isValidTestCaseClassNameForInvalidClassNamesReturnsFalse($className)
 {
     $this->assertFalse($this->fixture->isValidTestCaseClassName($className));
 }
Example #5
0
 /**
  * @test
  *
  * @dataProvider invalidTestCaseClassNameDataProvider
  *
  * @param string $className
  */
 public function isValidTestCaseClassNameForInvalidClassNamesReturnsFalse($className)
 {
     self::assertFalse($this->subject->isValidTestCaseClassName($className));
 }