You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

startsessionlistener.php 1.4KB

Make compatible with PHPUnit 5.1 `addWarning` needs to be defined as well for it: ``` ➜ master git:(master) ✗ bash autotest.sh sqlite Using PHP executable /usr/local/opt/php56/bin/php Parsing all files in lib/public for the presence of @since or @deprecated on each method... Using database oc_autotest Setup environment for sqlite testing on local storage ... Installing .... ownCloud is not installed - only a limited number of commands are available Mac OS X is not supported and ownCloud will not work properly on this platform. Use it at your own risk! -> For the best results, please consider using a GNU/Linux server instead. creating sqlite db ownCloud was successfully installed Testing with sqlite ... No coverage /usr/local/bin/phpunit --configuration phpunit-autotest.xml --log-junit autotest-results-sqlite.xml PHP Notice: Constant PHPUNIT_RUN already defined in /Users/lukasreschke/Documents/Programming/master/apps/firstrunwizard/tests/bootstrap.php on line 6 PHP Stack trace: PHP 1. {main}() /usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar:0 PHP 2. PHPUnit_TextUI_Command::main() /usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar:514 PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/Command.php:106 PHP 4. PHPUnit_TextUI_Command->handleArguments() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/Command.php:117 PHP 5. PHPUnit_Util_Configuration->getTestSuiteConfiguration() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/Command.php:663 PHP 6. PHPUnit_Util_Configuration->getTestSuite() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/Util/Configuration.php:796 PHP 7. PHPUnit_Framework_TestSuite->addTestFile() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/Util/Configuration.php:926 PHP 8. PHPUnit_Util_Fileloader::checkAndLoad() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/Framework/TestSuite.php:335 PHP 9. PHPUnit_Util_Fileloader::load() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/Util/Fileloader.php:38 PHP 10. include_once() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/Util/Fileloader.php:56 PHP 11. loadDirectory() /Users/lukasreschke/Documents/Programming/master/tests/apps.php:42 PHP 12. require_once() /Users/lukasreschke/Documents/Programming/master/tests/apps.php:20 PHP 13. define() /Users/lukasreschke/Documents/Programming/master/apps/firstrunwizard/tests/bootstrap.php:6 PHP Fatal error: Class StartSessionListener contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addWarning) in /Users/lukasreschke/Documents/Programming/master/tests/startsessionlistener.php on line 47 PHP Stack trace: PHP 1. {main}() /usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar:0 PHP 2. PHPUnit_TextUI_Command::main() /usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar:514 PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/Command.php:106 PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/Command.php:155 PHP 5. PHPUnit_TextUI_TestRunner->handleConfiguration() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/TestRunner.php:153 PHP 6. require_once() phar:///usr/local/Cellar/phpunit/5.1.0/libexec/phpunit-5.1.0.phar/phpunit/TextUI/TestRunner.php:805 ```
8 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. /**
  9. * Starts a new session before each test execution
  10. */
  11. class StartSessionListener implements PHPUnit_Framework_TestListener {
  12. public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
  13. }
  14. public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
  15. }
  16. public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
  17. }
  18. public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
  19. }
  20. public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
  21. }
  22. public function startTest(PHPUnit_Framework_Test $test) {
  23. }
  24. public function endTest(PHPUnit_Framework_Test $test, $time) {
  25. // reopen the session - only allowed for memory session
  26. if (\OC::$server->getSession() instanceof \OC\Session\Memory) {
  27. /** @var $session \OC\Session\Memory */
  28. $session = \OC::$server->getSession();
  29. $session->reopen();
  30. }
  31. }
  32. public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
  33. }
  34. public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
  35. }
  36. public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_Warning $e, $time) {
  37. }
  38. }