Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Merge develop with feature-testability branch #78

merged 90 commits into from Jun 6, 2012


None yet
6 participants

k00ni commented May 29, 2012

And make it possible to run PHPUnit tests. It will be fine to build up test cases in develop-branch to test the latest functions/classes. The testability-branch is very old and some of its classes (for instance the whole extension related stuff) differs from these in the develop-branch. Thus, we should merge the changes as soon as possible and to go forward with ONE branch (develop) which contains cutting edge stuff + test environment.

pfrischmuth and others added some commits Dec 14, 2010

@pfrischmuth pfrischmuth Added initial service controller test. Fixed auth action for testabil…
…ity (return instead of exit). Exit approach seemed to be broken in this case, since always a 200 HTTP status code was returned.
@pfrischmuth pfrischmuth Issue 947: Reset the navigation singleton on every bootstrap; load co…
…mponent helper classes iff not already available
@pfrischmuth pfrischmuth Added auth action tests; Refactored and fixed auth action in service …
@k00ni k00ni - add: make section for easier use of phpunit (make test and go!)
- add: TestSuite which contains the TestCases
@k00ni k00ni - add: TestSuite fb69720
@k00ni k00ni - chg: Update Zend Framework Version from 1.9.4 to 1.11.1 (contains a…
… bugfix which is needed for UnitTesting)
@k00ni k00ni - chg: Add if's before constant definitions because of PHPUnit which …
…tries to re-define the constants -> errors
@k00ni k00ni - add: 2 tests for sparqlAction
- add: missing HttpResponseCodes
- add: try catch during questioning the model because of a possible Erfurt_Ac_Exception exception
- del: some exits
@k00ni k00ni - del: Test var_dump e5a85cd
@seebi seebi + erfurt test target 2d4abf3
@seebi seebi + Zend path 547d55d
@pfrischmuth pfrischmuth Started refactoring of test environment: renamed test_base to TestHel…
…per, Modified ServiceControllerTest to enable direct execution; Needs to be documented
@pfrischmuth pfrischmuth Modified index controller test to include TestHelper; removed hashban…
…g, since it was echoed, when test suite is executed
@pfrischmuth pfrischmuth Started testing and refactoring of index controller; Makefile modifie…
…d test command
@pfrischmuth pfrischmuth Added controller test suite e0d5e54
@pfrischmuth pfrischmuth merge with default 73d3157
@pfrischmuth pfrischmuth Modified OntoWikiTest to fit new test structure 7004e15
@k00ni k00ni - chg: correct make test command in Makefile (Tests => tests) 6a4cbf1
@k00ni k00ni - chg: rename sparqlNoAuthWithQuery to sparqlNoAuthWithInvalidQuery
- add: sparqlAction-Test with Query "SELECT ?s WHERE { ?s ?p ?o. }" => Result as XML (#1)
- add: sparqlAction-Test with Query "SELECT ?s WHERE { ?s ?p ?o. }" => Result as JSON (#2)
- both Tests #1 and #2 are questioning an empty/not existable/invisible knowledge base and getting no result, right?
@k00ni k00ni - add: OntoWiki_TestSuite
- add: OntoWiki_TestSuite to tests/TestSuite.php
- port: OntoWiki/MessageTest.php into new Test-System
- add: MessageTest to OntoWiki_TestSuite
@pfrischmuth pfrischmuth Moved old/unused test files to deprecated folder for further cleanup. 41be23a
@pfrischmuth pfrischmuth Fixed OntoWiki_Message to pass tests. Added tests for OntoWiki_Message 3ca7732
@pfrischmuth pfrischmuth Test for index/messages action; Show no messages info if no messages …
…are pending.
@pfrischmuth pfrischmuth Test for index/news action; Cleaned up news action; now shows warning…
… message if feed loading fails.
@pfrischmuth pfrischmuth Test for index/newsshort action; Cleaned up newsshort action. 0aa7162
@pfrischmuth pfrischmuth Added RSS test data for news/newsshort action tests. 4a70a12
@pfrischmuth pfrischmuth merge with default ec86180
@pfrischmuth pfrischmuth Fixed test for __call method in order to achieve full code coverage. 02f19b1
@pfrischmuth pfrischmuth Removed @version, Added initial OntoWiki_Version class. 5aadd86
@pfrischmuth pfrischmuth merge with default ad8e870
@pfrischmuth pfrischmuth Added OntoWiki_Version test; full code coverage. 56fc86f
@pfrischmuth pfrischmuth Added OntoWiki_Version test to TestSuite f2fca3c
@pfrischmuth pfrischmuth Modified news feed import method to fit new OntoWiki_Version 00c4b1e
@pfrischmuth pfrischmuth Modified semanticsitemap extension to fit new OntoWiki_Version; Added…
… OntoWiki::APPLICATION_NAME constant.
@pfrischmuth pfrischmuth Replaced all occurrences of ini configured version with OntoWiki_Vers…
@pfrischmuth pfrischmuth Fixes wrapper registry usage for testability ecbf0da
@pfrischmuth pfrischmuth merge with default ff2247c
@pfrischmuth pfrischmuth merge with default c97241f
@pfrischmuth pfrischmuth Current state of fixing multiple bootstrapping support. Multiple boot…
…strapping of extension manager still fails, since multiple module registration fails.
@pfrischmuth pfrischmuth Modified branch of Erfurt library for refactoring 5482a6f
@pfrischmuth pfrischmuth Refactoring: Removed _initWrapperManager method from Boostrap 9ed9871
@k00ni k00ni - add: if before define constant EXTENSION_PATH and _OWSESSION. Cause…
… there are errors during tests if not.
@pfrischmuth pfrischmuth refactoring for testability 23cf1d4
@pfrischmuth pfrischmuth merge daa7efe
@0xfeedface 0xfeedface Merged with default a5b9dd0
@0xfeedface 0xfeedface Adds update helper and test 0ec01e1
@0xfeedface 0xfeedface Removes doubled method, testability improvements e4ceccb
@pfrischmuth pfrischmuth test mods f9efb9d
@pfrischmuth pfrischmuth merge with default ba784ee
@pfrischmuth pfrischmuth merge local heads 4018da6
@larseidam larseidam - add: Makefile options to install/uninstall/enable/disable the codes…

- add: Makefile options to check all files or only commit files with the codesniffer
- add: codesniffer folder with the ontowiki coding standard
- add: two scripts to manipulate the hgrc file (add/remove codesniffer precommit hook)
@larseidam larseidam - chg: hook to check only php files
- chg: adjust Ontowiki standard
- chg: sniff php files to accepted by the Ontowiki standard
- chg: makefile to check only php files
@larseidam larseidam - chg: syntaxerror -> one curved bracket too much in line 260
- chg: all other changes are to fulfill the coding standards
@larseidam larseidam merge default (2562) 12bb4ab
@larseidam larseidam - add: tearDown function, to fix the large proportion of tests 70fc7d4
@larseidam larseidam - add: variables in makefile to easy config the code sniffer
- chg: only one place for config variable in the makefile, so no need to edit
> the 'add-hook' script to chance the severity or something like that
@larseidam larseidam - merge: default 35ed955
@larseidam larseidam Merge with default a33d4df
@seebi seebi merge with default 0627481
@seebi seebi Merge branch 'master' into feature/testability
@k00ni k00ni Check if _OWDEBUG was already defined
Neccessary for re-instancing an OntoWiki in PHPUnit,
without it you'll get a warning
@k00ni k00ni Fix a warning in OntoWiki/Menu.php (replace $key with $entryKey) f49a383
@k00ni k00ni Merge feature-testability into develop
- Zend 1.x requires PHPUnit 3.5.x, otherwise you will
  get a warning:

  Declaration of Zend_Test_PHPUnit_Constraint_ResponseHeader::evaluate()
  should be compatible with that of PHPUnit_Framework_Constraint::evaluate()

- many classes were removed in the develop branch, so i did the same during
  merging and adapt the tests (remove some):

  - e.g. OntoWiki/Component/Manager.php

- Lots of tests are broken because of
  - missing functions
  - changed function behavior
  - changed function parameters

  i fix some, uncomment some and there still some which produces errors

- adapt whole test environment and "make test"

  No TestSuites, only TestCases
@k00ni k00ni Replace all exit's with replace's and add make test-extensions command
- An exit stops PHPUnit

- make test-extensions: to test all extensions which have test cases
is still incomplete/broken! Many errors, warnings, ...

k00ni commented May 30, 2012

I got another problem in TitleHelper itself. There is a TestCase with this setUp function, which contains:

$this->_owApp = new Zend_Application( 'default', _OWROOT . 'application/config/application.ini');
$logger = OntoWiki::getInstance()->logger;
$this->_model = new Erfurt_Rdf_Model ('http://data.lod2.eu/scoreboard/');
$this->_titleHelper = new OntoWiki_Model_TitleHelper ($this->_model);

When i do something with the TitleHelper in my own class (for instance execute addResource + getTitle) than i will get something like this:

PHP Fatal error: Call to a member function info() on a non-object in [...]/application/classes/OntoWiki/Model/TitleHelper.php on line 360
Fatal error: Call to a member function info() on a non-object in [...]/application/classes/OntoWiki/Model/TitleHelper.php on line 360
make: *** [test] Error 255


PHP Fatal error: Call to a member function debug() on a non-object in [...]/application/classes/OntoWiki/Model/TitleHelper.php on line 451
Fatal error: Call to a member function debug() on a non-object in [...]/application/classes/OntoWiki/Model/TitleHelper.php on line 451
make: *** [test] Error 255

The lines 360 and 451 contains:

$logger->info('TitleHelper: ' . $numQueries . ' queries with ' . count($this->_resources) . ' resources.');


$logger->debug('TitleHelper _fetchResourceTitlesFromQueryResult count(bindings): ' . count($bindings));

After i add this lines of code before the info- and debug function call, everything works well:

$writer = new Zend_Log_Writer_Stream(dirname(FILE).'/../../../../logs/ontowiki.log');
$logger = new Zend_Log($writer);

I guess there is something missing in my setUp function, so the Logger is not properly initialized. Any ideas?


k00ni commented Jun 4, 2012

Now, all test cases don't run into Failures anymore, but they are still produce errors.


k00ni commented Jun 4, 2012

As of now, the whole test suite runs without throw errors or warnings. But there are a lot of functions commented out! Thus, we have to think about how we can reactivate / rewrite the test cases.


k00ni commented Jun 4, 2012

As of now, the extensions will also not throwing any errors or warnings during the tests.

k00ni and others added some commits Jun 5, 2012

@k00ni k00ni Merge branch 'develop' of github.com:AKSW/OntoWiki into develop
@k00ni k00ni Adapt head comment (2011->2012) and clear Bootstrap and OntoWiki code 76e767e
@k00ni k00ni Move InstancesTest.php c4c4f7d
@k00ni k00ni Some code niceups b875c5b
@k00ni k00ni Change OntoWiki_Navigation to a non-static class
Add a test case for the class
@k00ni k00ni Port all the OntoWiki_Navigation calls to new way of life 38b3b71
@k00ni k00ni Merge branch 'develop' of github.com:AKSW/OntoWiki into refactor-onto…


And reactivate most of the 56 old tests.
@k00ni k00ni Refix TitleHelper (Logger problem) 0146818
@pfrischmuth pfrischmuth Fixes for controller test cases 1557701
@k00ni k00ni FILE__ to __FILE__ in TitleHelper 4cfcd07
@k00ni k00ni Merge branch 'develop' of github.com:k00ni/OntoWiki into develop 4741938
@k00ni k00ni Restore ServiceControllerTest.php from ASKW/OntoWiki->testability branch 8e4730c
@k00ni k00ni Fix ServiceControllerTest->testAuthActionGetAllowed (allow get auth) 843de2a
@k00ni k00ni Fix auth and sparql Actions of ServiceController
- add response codes for sparql Action
- fix undefined $logout warning
- in ServiceControllerTest the username/password to u/p
- comment out ServiceControllerTest->testAuthActionInvalidUser
@pfrischmuth pfrischmuth Enabled testMethod again; updated Erfurt submodule 043f5cc

pfrischmuth commented Jun 6, 2012

All changes from the AKSW develop branch were merged in and OntoWiki basic workflow was tested as well as OntoWiki units tests on my system again. I think we should finally merge this into the main develop branch.

Thanks to Konrad for his work on this!

@pfrischmuth pfrischmuth added a commit that referenced this pull request Jun 6, 2012

@pfrischmuth pfrischmuth Merge pull request #78 from k00ni/develop
Merge develop with feature-testability branch

This merges a feature branch into the main develop branch that exists for quite a while. It mainly contains improvements for unit testing the application.

@pfrischmuth pfrischmuth merged commit 50493a4 into AKSW:develop Jun 6, 2012


white-gecko commented on 573181e Jun 7, 2012

The SiteController doesn't belong into the OntoWiki repository


white-gecko replied Jun 7, 2012

And what does application/tests/controllers/_files/aksw.rss do?


pfrischmuth replied Jun 7, 2012

This file exists for testing purposes.


white-gecko replied Jun 7, 2012

But it looks as if it will change frequently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment