Пример #1
0
 /**
  * @test
  */
 public function isSeleniumServerRunningWhenHostIsInvalidReturnsFalse()
 {
     // We will use 'example.invalid' as an invalid host
     // (according to RFC 2606 the TLD '.invalid' should be used to test for invalid hosts).
     $this->extensionSettingsService->set('selenium_host', 'http://example.invalid');
     self::assertFalse($this->subject->isSeleniumServerRunning());
 }
Пример #2
0
 /**
  * @test
  */
 public function ajaxBrokerForFailureCheckboxParameterAndMissingStateSavesFalseStateToUserSettings()
 {
     $GLOBALS['_POST']['checkbox'] = 'failure';
     /** @var $ajax AjaxRequestHandler|PHPUnit_Framework_MockObject_MockObject  */
     $ajax = $this->getMock('TYPO3\\CMS\\Core\\Http\\AjaxRequestHandler', array(), array(''));
     $this->subject->ajaxBroker(array(), $ajax);
     self::assertFalse($this->userSettingsService->getAsBoolean('failure'));
 }
Пример #3
0
 /**
  * @test
  */
 public function ajaxBrokerForFailureCheckboxParameterAndMissingStateSavesFalseStateToUserSettings()
 {
     $GLOBALS['_POST']['checkbox'] = 'failure';
     /** @var $ajax TYPO3AJAX|PHPUnit_Framework_MockObject_MockObject  */
     $ajax = $this->getMock('TYPO3AJAX', array(), array(''));
     $this->fixture->ajaxBroker(array(), $ajax);
     $this->assertFalse($this->userSettingsService->getAsBoolean('failure'));
 }
Пример #4
0
 /**
  * @test
  */
 public function setCanSetArrayValue()
 {
     $key = 'foo';
     $value = array('foo', 'foobar');
     $this->subject->set($key, $value);
     self::assertSame($value, $this->subject->getAsArray($key));
 }
Пример #5
0
 /**
  * @test
  */
 public function createTestCaseSelectorMarksNoTestCaseSelectedTestCaseAsNotSelected()
 {
     $selectedExtension = 'phpunit';
     $this->userSettingsService->set('extSel', $selectedExtension);
     $this->request->set('testCaseFile', '');
     self::assertNotRegExp('#<option [^>]* selected="selected">Tx_Phpunit_Tests_Unit_BackEnd_ModuleTest</option>#', $this->subject->createTestCaseSelector($selectedExtension));
 }
 /**
  * @test
  */
 public function setCanSetArrayValue()
 {
     $key = 'foo';
     $value = array('foo', 'foobar');
     $this->fixture->set($key, $value);
     $this->assertSame($value, $this->fixture->getAsArray($key));
 }
Пример #7
0
 /**
  * @test
  */
 public function runTestWhenServerIsNotRunningMarksTestAsSkipped()
 {
     $this->extensionSettingsService->set('selenium_host', 'http://example.invalid');
     $subject = new \Tx_Phpunit_Selenium_TestCase(null, array(), '', $this->extensionSettingsService);
     try {
         $subject->runTest();
     } catch (PHPUnit_Framework_SkippedTestError $e) {
         self::assertTrue(true);
     }
 }
Пример #8
0
 /**
  * @test
  */
 public function runTestWhenServerIsNotRunningMarksTestAsSkipped()
 {
     $this->extensionSettingsService->set('selenium_host', 'http://example.invalid');
     $fixture = new Tx_Phpunit_Selenium_TestCase();
     try {
         $fixture->runTest();
     } catch (PHPUnit_Framework_SkippedTestError $e) {
         $this->assertTrue(TRUE);
     }
 }
Пример #9
0
 /**
  * @test
  */
 public function getExcludedExtensionKeysForNoExcludedExtensionsReturnsEmptyArray()
 {
     $this->extensionSettingsService->set('excludeextensions', '');
     $this->assertSame(array(), $this->fixture->getExcludedExtensionKeys());
 }