/** * @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()); }
/** * @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')); }
/** * @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')); }
/** * @test */ public function setCanSetArrayValue() { $key = 'foo'; $value = array('foo', 'foobar'); $this->subject->set($key, $value); self::assertSame($value, $this->subject->getAsArray($key)); }
/** * @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)); }
/** * @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); } }
/** * @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); } }
/** * @test */ public function getExcludedExtensionKeysForNoExcludedExtensionsReturnsEmptyArray() { $this->extensionSettingsService->set('excludeextensions', ''); $this->assertSame(array(), $this->fixture->getExcludedExtensionKeys()); }