This repository has been archived by the owner. It is now read-only.

Application Layer Rework Phase 1: JWeb & JWebConfig #378

merged 91 commits into from Sep 23, 2011


None yet
5 participants

LouisLandry commented Sep 21, 2011

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.

I think you mean language here.


LouisLandry replied Sep 19, 2011

sigh ... yes I do. Thanks!

eddieajau and others added some commits Sep 19, 2011

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.

LouisLandry and others added some commits Sep 20, 2011

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.
Added JPluginHelperInspector to provide the ability to manually override
the loaded plugin list for testing and mocking purposes.

ianmacl added a commit that referenced this pull request Sep 23, 2011

Merge pull request #378 from LouisLandry/web
Application Layer Rework Phase 1: JWeb & JWebConfig

@ianmacl ianmacl merged commit cabe7cb into joomla:staging Sep 23, 2011


chdemko commented on 92070fc Sep 27, 2011

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 subscribe to this conversation on GitHub. Already have an account? Sign in.