Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Application Layer Rework Phase 1: JWeb & JWebConfig #378

Merged
merged 91 commits into from

5 participants

@LouisLandry

This pull request introduces a new JWeb class to encapsulate a web application for the Joomla Platform. In addition to JWeb I am also adding JWebClient which serves as a very lightweight yet productive Web client detector -- many thanks to Elin Waring for helping with research. Both classes come thoroughly unit tested; 92% code coverage for JWeb and 82% coverage for JWebClient.

As a part of this work I also ensured functional parity between JWeb and JCli so that writing applications for either SAPI is familiar and fluid. JCli also now sports 100% code coverage. Both JWeb and JCli also fully support dependency injection for all dependent objects for increased flexibility and testability.

Also included in this pull request are a great number of additions/fixes to the unit testing system to make it easier to mock out various classes within the Joomla Platform.

@elinw

I think you mean language here.

sigh ... yes I do. Thanks!

eddieajau and others added some commits
@eddieajau eddieajau Bug fix function passed to array. 29b9fe9
@eddieajau eddieajau Fix assignment bug in constructor. 0babba8
@eddieajau eddieajau Fix up unit tests a bit for new JWebClient class. 1e5ba39
@eddieajau eddieajau Skeleton remaining test methods. adf09f2
@eddieajau eddieajau Stubbed out incomplete tests and protected inspector methods. bd7d1e5
@LouisLandry LouisLandry Fixing up some unit tests for JWebClient 6840d3f
@LouisLandry LouisLandry Fix some document blocks. b169cde
@eddieajau eddieajau Merge branch 'web' of https://github.com/LouisLandry/joomla-platform
…into web2
1956dfd
@eddieajau eddieajau Merge branch 'dispatcher-fix' into web2 5de4cb5
@eddieajau eddieajau Added support for global JDocument mock. e1d2812
@eddieajau eddieajau Added more tests for JWeb. 191c460
@eddieajau eddieajau Added tests for JWeb::initialise with false injection. be0b1a4
@eddieajau eddieajau Fix up some docblocks. bf9e19b
@eddieajau eddieajau Ensure that the real classes that are being mocked are loaded before …
…the mock is created otherwise the empty parent class the mock creates for the parent will be used permanantly.
dd0791c
@eddieajau eddieajau Added more tests to JWeb. 957ae69
@eddieajau eddieajau Added JLanguage::_ support to the global language mock. 1c597d6
@eddieajau eddieajau Merge branch 'web2' of ssh://github.com/eddieajau/joomla-platform int…
…o web2
7994596
@LouisLandry LouisLandry Changing onAfterInitialise to onBeforeExecute in JWeb 7d1ee26
@eddieajau eddieajau Merge branch 'web' of https://github.com/LouisLandry/joomla-platform
…into web2
1a04c30
@eddieajau eddieajau Added test for clearHeaders. 37f7728
@eddieajau eddieajau Added option to fetchConfigurationData to configure the filename. 458c5f7
@eddieajau eddieajau Adding more tests to JWeb 92070fc
@eddieajau eddieajau Fixed a bug in JWeb::setHeader where unsetting an array index would l…
…eave some junk.
230d915
@eddieajau eddieajau More tests for JWeb. f767aa7
@eddieajau eddieajau Added test for JWeb::triggerEvent 6d2b882
@eddieajau eddieajau Added parse and render to the JDocument mock. 3ba27b6
@eddieajau eddieajau Added array to track which events have been triggered in the dispatch…
…er mock.
4aecf87
@eddieajau eddieajau Added chaining support to JWeb::registerEvent. b9abf5f
@eddieajau eddieajau Added more tests for JWeb. fd3821d
@LouisLandry LouisLandry Adjustments to JWeb and JWebInspector to improve testability. f3c1439
@LouisLandry LouisLandry Merge branch 'eddieajau-llandry-web' into web d6c47ab
@LouisLandry LouisLandry Minor access modifier mistake in JWebInspector. cb771b8
@LouisLandry LouisLandry Adding a way to verify JWeb::close() while testing. f464fad
@LouisLandry LouisLandry Adding tests for JWeb::compress() 929559e
@LouisLandry LouisLandry Adding some unit test coverage annotations. 6805f2a
@eddieajau eddieajau Finished test for JWeb::sendHeaders. bcabecb
@eddieajau eddieajau Merge branch 'web' of https://github.com/LouisLandry/joomla-platform
…into web2
3516dd3
@LouisLandry LouisLandry Adding some unit test coverage annotations. db2902f
@LouisLandry LouisLandry Merge branch 'eddieajau-llandry-web' into web 5afc572
@eddieajau eddieajau Added tests for JWeb::redirect. 396c1e8
@LouisLandry LouisLandry Adding tests for JWeb::loadSystemUris() 526044a
@LouisLandry LouisLandry Merge branch 'eddieajau-llandry-web' into web 4065699
@eddieajau eddieajau Completed tests for JWeb::redirect. 7708c99
@eddieajau eddieajau Merge branch 'web' of https://github.com/LouisLandry/joomla-platform
…into web2
056f0c8
@LouisLandry LouisLandry Fixing up code style issue. 425120c
@eddieajau eddieajau Fixing up JWeb example to suit new design. 63e297d
@eddieajau eddieajau Added basic test for JWeb::render. 63bb348
@eddieajau eddieajau Fixed bug in example. 5600704
@LouisLandry LouisLandry Merge branch 'eddieajau-llandry-web' into web a1de3c5
@LouisLandry LouisLandry Working on application class parity. 64f6198
@LouisLandry LouisLandry Merge branch 'master' of github.com:joomla/joomla-platform into web 458ce46
@eddieajau eddieajau Added base set of tests for JCli (based on JWeb). bff287f
@LouisLandry LouisLandry Merge branch 'eddieajau-llandry-web' into web 98fedb8
@eddieajau eddieajau Added missing skeleton methods to JDaemon test file. 8af0cc7
@LouisLandry LouisLandry Some fixes for JCli and tests. 312768d
@LouisLandry LouisLandry Merge branch 'eddieajau-llandry-web' into web edd5246
@LouisLandry LouisLandry Some adjustments to JDaemon and tests. 58171d0
@eddieajau eddieajau Added JCli::get method. 1be6b21
@eddieajau eddieajau More tests for JCli. 47ae9de
@eddieajau eddieajau Added 'test' method to JDispatcherGlobalMock to assist with testing
dependancy injection.
256249d
@eddieajau eddieajau Merge branch 'master' of github.com:joomla/joomla-platform into web2 280e9b7
@LouisLandry LouisLandry Merge branch 'web2' of github.com:eddieajau/joomla-platform into andrew 737864d
@LouisLandry LouisLandry Removing unnecessary example applications. See the separate repository
for platform example applications.
a3cfb64
@eddieajau eddieajau Modified the way JDispatcher was being mocked and tested. 3dde131
@eddieajau eddieajau Removed the reset ability from getDispatcherMock. f3ba5f1
@eddieajau eddieajau Added tests for JCli execute and loadDocument. 202266c
@eddieajau eddieajau Merge branch 'web' of https://github.com/LouisLandry/joomla-platform
…into web2
39a769a
@eddieajau eddieajau Converted list of loaded plugins from static variable to protected
static class property so that JPluginHelper can be extended for testing
and manually override the list of loaded plugins.
f583d88
@eddieajau eddieajau Added JPluginHelperInspector to provide the ability to manually override
the loaded plugin list for testing and mocking purposes.
f750f7b
@eddieajau eddieajau Repaired user authentication tests due to changes in how JDispatcher
mocking is handled.
2002fcf
@LouisLandry LouisLandry Improving the daemon tests and fixtures. b4345d2
@eddieajau eddieajau Fixing up Docblock. 34762ee
@LouisLandry LouisLandry Merge branch 'andrew' into web 04aa70a
@eddieajau eddieajau Merge branch 'web' of https://github.com/LouisLandry/joomla-platform
…into web2
68c710d
@LouisLandry LouisLandry Changing some code coverage issues. cdad741
@LouisLandry LouisLandry Fixing up some code coverage issues with JCli 32c2bb5
@LouisLandry LouisLandry Adding test coverage for JDaemon::setupSignalHandlers() 5f73eb9
@LouisLandry LouisLandry Fixing checkstyle warnings. 145975f
@ianmacl ianmacl merged commit cabe7cb into from
@chdemko

Hi Andrew, this is breaking unit test

PHP Fatal error: Cannot redeclare class JConfig in /home/chdemko/Code/php/joomla/joomla-platform/git/tests/test_application/configuration.php on line 12
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:49
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:129
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:188
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:305
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:693
PHP 7. PHPUnit_Framework_TestSuite->runTest() /usr/share/pear/PHPUnit/Framework/TestSuite.php:733
PHP 8. PHPUnit_Framework_TestCase->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:757
PHP 9. PHPUnit_Framework_TestResult->run() /usr/share/pear/PHPUnit/Framework/TestCase.php:576
PHP 10. PHPUnit_Framework_TestCase->runBare() /usr/share/pear/PHPUnit/Framework/TestResult.php:666
PHP 11. JDocumentOpensearchTest->setUp() /usr/share/pear/PHPUnit/Framework/TestCase.php:626
PHP 12. PHPUnit_Framework_TestCase->getMock() /home/chdemko/Code/php/joomla/joomla-platform/git/tests/suite/joomla/document/opensearch/JDocumentOpensearchTest.php:49
PHP 13. PHPUnit_Framework_MockObject_Generator::getMock() /usr/share/pear/PHPUnit/Framework/TestCase.php:1035
PHP 14. ReflectionClass->newInstanceArgs() /usr/share/pear/PHPUnit/Framework/MockObject/Generator.php:193
PHP 15. JApplication->__construct() /usr/share/pear/PHPUnit/Framework/MockObject/Generator.php:193
PHP 16. JApplication->_createConfiguration() /home/chdemko/Code/php/joomla/joomla-platform/git/libraries/joomla/application/application.php:136
PHP 17. include_once() /home/chdemko/Code/php/joomla/joomla-platform/git/libraries/joomla/application/application.php:983

Fatal error: Cannot redeclare class JConfig in /home/chdemko/Code/php/joomla/joomla-platform/git/tests/test_application/configuration.php on line 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 10, 2011
  1. @LouisLandry
Commits on Sep 15, 2011
  1. @LouisLandry
  2. @LouisLandry

    More work on JWeb.

    LouisLandry authored
Commits on Sep 16, 2011
  1. @LouisLandry
  2. @LouisLandry
  3. @LouisLandry
  4. @eddieajau
  5. @eddieajau
Commits on Sep 17, 2011
  1. @eddieajau

    Added an example JWeb application that demonstrates the use of

    eddieajau authored
    appendBody and accessing the user agent information.
  2. @eddieajau
Commits on Sep 18, 2011
  1. @LouisLandry
  2. @LouisLandry
  3. @eddieajau

    Merge branch 'web' of https://github.com/LouisLandry/joomla-platform

    eddieajau authored
    into llandry-web
    
    Conflicts:
    	libraries/joomla/application/web.php
Commits on Sep 19, 2011
  1. @eddieajau
  2. @eddieajau
  3. @eddieajau
  4. @eddieajau
  5. @eddieajau
  6. @LouisLandry
  7. @LouisLandry

    Fix some document blocks.

    LouisLandry authored
  8. @eddieajau
  9. @eddieajau
  10. @eddieajau
  11. @eddieajau

    Added more tests for JWeb.

    eddieajau authored
  12. @eddieajau
  13. @eddieajau

    Fix up some docblocks.

    eddieajau authored
  14. @eddieajau

    Ensure that the real classes that are being mocked are loaded before …

    eddieajau authored
    …the mock is created otherwise the empty parent class the mock creates for the parent will be used permanantly.
  15. @eddieajau

    Added more tests to JWeb.

    eddieajau authored
  16. @eddieajau
  17. @eddieajau
  18. @LouisLandry
  19. @eddieajau
  20. @eddieajau

    Added test for clearHeaders.

    eddieajau authored
  21. @eddieajau
Commits on Sep 20, 2011
  1. @eddieajau

    Adding more tests to JWeb

    eddieajau authored
  2. @eddieajau
  3. @eddieajau

    More tests for JWeb.

    eddieajau authored
  4. @eddieajau
  5. @eddieajau
  6. @eddieajau
  7. @eddieajau
  8. @eddieajau

    Added more tests for JWeb.

    eddieajau authored
  9. @LouisLandry
  10. @LouisLandry
  11. @LouisLandry
  12. @LouisLandry
  13. @LouisLandry
  14. @LouisLandry
  15. @eddieajau
  16. @eddieajau
  17. @LouisLandry
  18. @LouisLandry
  19. @eddieajau
  20. @LouisLandry
  21. @LouisLandry
  22. @eddieajau
  23. @eddieajau
  24. @LouisLandry
  25. @eddieajau
  26. @eddieajau
  27. @eddieajau

    Fixed bug in example.

    eddieajau authored
  28. @LouisLandry
Commits on Sep 21, 2011
  1. @LouisLandry
  2. @LouisLandry
  3. @eddieajau
  4. @LouisLandry
  5. @eddieajau
  6. @LouisLandry
  7. @LouisLandry
  8. @LouisLandry
  9. @eddieajau

    Added JCli::get method.

    eddieajau authored
  10. @eddieajau

    More tests for JCli.

    eddieajau authored
  11. @eddieajau
  12. @eddieajau
  13. @LouisLandry
  14. @LouisLandry

    Removing unnecessary example applications. See the separate repository

    LouisLandry authored
    for platform example applications.
  15. @eddieajau
  16. @eddieajau
  17. @eddieajau
  18. @eddieajau
  19. @eddieajau

    Converted list of loaded plugins from static variable to protected

    eddieajau authored
    static class property so that JPluginHelper can be extended for testing
    and manually override the list of loaded plugins.
  20. @eddieajau

    Added JPluginHelperInspector to provide the ability to manually override

    eddieajau authored
    the loaded plugin list for testing and mocking purposes.
  21. @eddieajau
  22. @LouisLandry
  23. @eddieajau

    Fixing up Docblock.

    eddieajau authored
  24. @LouisLandry
  25. @eddieajau
  26. @LouisLandry
  27. @LouisLandry
  28. @LouisLandry
  29. @LouisLandry
Something went wrong with that request. Please try again.