\JApplicationWebTest
Test class for JApplicationWeb.
Synopsis
class JApplicationWebTest
extends TestCase
{
- // constants
- const TEST_HTTP_HOST = 'mydomain.com';
- const TEST_USER_AGENT = 'Mozilla/5.0';
- const TEST_REQUEST_URI = '/index.php';
- // members
- protected JApplicationWebInspector $class;
- // Inherited members from TestCase
- protected $expectedErrors;
- // methods
- public array getDetectRequestUriData()
- public array getRedirectData()
- public void setUp()
- protected void tearDown()
- public void test__construct()
- public void test__constructDependancyInjection()
- public void testAllowCache()
- public void testAppendBody()
- public void testClearHeaders()
- public void testClose()
- public void testCompressWithGzipEncoding()
- public void testCompressWithDeflateEncoding()
- public void testCompressWithNoAcceptEncodings()
- public void testCompressWithHeadersSent()
- public void testCompressWithUnsupportedEncodings()
- public void testDetectRequestUri()
- public void testExecuteWithoutDocument()
- public void testExecuteWithDocument()
- public array getFetchConfigurationData()
- public void testFetchConfigurationData()
- public void testGet()
- public void testGetBody()
- public void testGetHeaders()
- public void testGetInstance()
- public void testInitialiseWithDefaults()
- public void testInitialiseWithFalse()
- public void testInitialiseWithInjection()
- public void testLoadConfiguration()
- public void testLoadDocument()
- public void testLoadLanguage()
- public void testLoadSession()
- public void testLoadSystemUrisWithSiteUriSet()
- public void testLoadSystemUrisWithoutSiteUriSet()
- public void testLoadSystemUrisWithoutSiteUriWithMediaUriSet()
- public void testLoadSystemUrisWithoutSiteUriWithRelativeMediaUriSet()
- public void testPrependBody()
- public void testRedirect()
- public void testRedirectWithHeadersSent()
- public void testRedirectWithJavascriptRedirect()
- public void testRedirectWithMoved()
- public void testRedirectWithUrl()
- public void testRegisterEvent()
- public void testRender()
- public void testRespond()
- public void testSendHeaders()
- public void testSet()
- public void testSetBody()
- public void testSetHeader()
- public void testIsSSLConnection()
- // Inherited methods from TestCase
- public static boolean errorCallback()
- public void assignMockCallbacks()
- public void assignMockReturns()
- public JException expectedErrorCallback()
- public JApplication getMockApplication()
- public JApplicationCms getMockCmsApp()
- public JConfig getMockConfig()
- public JDatabase getMockDatabase()
- public JEventDispatcher getMockDispatcher()
- public JDocument getMockDocument()
- public JLanguage getMockLanguage()
- public JSession getMockSession()
- public JApplicationWeb getMockWeb()
- public void setExpectedError()
- protected void restoreErrorHandlers()
- protected void restoreFactoryState()
- protected void saveErrorHandlers()
- protected void saveFactoryState()
- protected void setErrorHandlers()
- protected void setErrorCallback()
- protected void setUp()
- protected void tearDown()
Hierarchy
Extends
Tasks
Tasks
Line | Task |
---|---|
162 | Test that configuration data loaded. |
969 | JSession default is not tested properly. |
Constants
Name | Value |
---|---|
TEST_HTTP_HOST | 'mydomain.com' |
TEST_USER_AGENT | 'Mozilla/5.0' |
TEST_REQUEST_URI | '/index.php' |
Members
protected
- $class
—
JApplicationWebInspector
An instance of the class to test. - $expectedErrors — array
Methods
protected
- tearDown() — Overrides the parent tearDown method.
public
- getDetectRequestUriData() — Data for detectRequestUri method.
- getFetchConfigurationData() — Data for fetchConfigurationData method.
- getRedirectData() — Data for fetchConfigurationData method.
- setUp() — Setup for testing.
- testAllowCache() — Tests the JApplicationWeb::allowCache method.
- testAppendBody() — Tests the JApplicationWeb::appendBody method.
- testClearHeaders() — Tests the JApplicationWeb::clearHeaders method.
- testClose() — Tests the JApplicationWeb::close method.
- testCompressWithDeflateEncoding() — Tests the JApplicationWeb::compress method.
- testCompressWithGzipEncoding() — Tests the JApplicationWeb::compress method.
- testCompressWithHeadersSent() — Tests the JApplicationWeb::compress method.
- testCompressWithNoAcceptEncodings() — Tests the JApplicationWeb::compress method.
- testCompressWithUnsupportedEncodings() — Tests the JApplicationWeb::compress method.
- testDetectRequestUri() — Tests the JApplicationWeb::detectRequestUri method.
- testExecuteWithDocument() — Tests the JApplicationWeb::Execute method with a document.
- testExecuteWithoutDocument() — Tests the JApplicationWeb::Execute method without a document.
- testFetchConfigurationData() — Tests the JCli::fetchConfigurationData method.
- testGet() — Tests the JApplicationWeb::get method.
- testGetBody() — Tests the JApplicationWeb::getBody method.
- testGetHeaders() — Tests the JApplicationWeb::getHeaders method.
- testGetInstance() — Tests the JApplicationWeb::getInstance method.
- testInitialiseWithDefaults() — Tests the JApplicationWeb::initialise method with default settings.
- testInitialiseWithFalse() — Tests the JApplicationWeb::initialise method with false injection.
- testInitialiseWithInjection() — Tests the JApplicationWeb::initialise method with dependancy injection.
- testIsSSLConnection() — Tests the isSSLConnection method
- testLoadConfiguration() — Tests the JApplicationWeb::loadConfiguration method.
- testLoadDocument() — Tests the JApplicationWeb::loadDocument method.
- testLoadLanguage() — Tests the JApplicationWeb::loadLanguage method.
- testLoadSession() — Tests the JApplicationWeb::loadSession method.
- testLoadSystemUrisWithSiteUriSet() — Tests the JApplicationWeb::loadSystemUris method.
- testLoadSystemUrisWithoutSiteUriSet() — Tests the JApplicationWeb::loadSystemUris method.
- testLoadSystemUrisWithoutSiteUriWithMediaUriSet() — Tests the JApplicationWeb::loadSystemUris method.
- testLoadSystemUrisWithoutSiteUriWithRelativeMediaUriSet() — Tests the JApplicationWeb::loadSystemUris method.
- testPrependBody() — Tests the JApplicationWeb::prependBody method.
- testRedirect() — Tests the JApplicationWeb::redirect method.
- testRedirectWithHeadersSent() — Tests the JApplicationWeb::redirect method with headers already sent.
- testRedirectWithJavascriptRedirect() — Tests the JApplicationWeb::redirect method with headers already sent.
- testRedirectWithMoved() — Tests the JApplicationWeb::redirect method with moved option.
- testRedirectWithUrl() — Tests the JApplicationWeb::redirect method with assorted URL's.
- testRegisterEvent() — Tests the JApplicationWeb::registerEvent method.
- testRender() — Tests the JApplicationWeb::render method.
- testRespond() — Tests the JApplicationWeb::respond method.
- testSendHeaders() — Tests the JApplicationWeb::sendHeaders method.
- testSet() — Tests the JApplicationWeb::set method.
- testSetBody() — Tests the JApplicationWeb::setBody method.
- testSetHeader() — Tests the JApplicationWeb::setHeader method.
- test__construct() — Tests the JApplicationWeb::__construct method.
- test__constructDependancyInjection() — Tests the JApplicationWeb::__construct method with dependancy injection.
Inherited from TestCase
protected
- restoreErrorHandlers() — Sets the JError error handlers.
- restoreFactoryState() — Sets the Factory pointers
- saveErrorHandlers() — Saves the current state of the JError error handlers.
- saveFactoryState() — Saves the Factory pointers
- setErrorCallback() — Sets the JError error handlers to callback mode and points them at the test logging method.
- setErrorHandlers() — Sets the JError error handlers.
- setUp() — Overrides the parent setup method.
- tearDown() — Overrides the parent tearDown method.
public
- assignMockCallbacks() — Assigns mock callbacks to methods.
- assignMockReturns() — Assigns mock values to methods.
- errorCallback() — Receives the callback from JError and logs the required error information for the test.
- expectedErrorCallback() — Callback receives the error from JError and deals with it appropriately If a test expects a JError to be raised, it should call this setExpectedError first If you don't call this method first, the test will fail.
- getMockApplication() — Gets a mock application object.
- getMockCmsApp() — Gets a mock CMS application object.
- getMockConfig() — Gets a mock configuration object.
- getMockDatabase() — Gets a mock database object.
- getMockDispatcher() — Gets a mock dispatcher object.
- getMockDocument() — Gets a mock document object.
- getMockLanguage() — Gets a mock language object.
- getMockSession() — Gets a mock session object.
- getMockWeb() — Gets a mock web object.
- setExpectedError() — Tells the unit tests that a method or action you are about to attempt is expected to result in JError::raiseSomething being called.