Index: trunk/extensions/UnitTest/tests/TestConfiguration.php.dist |
— | — | @@ -0,0 +1,54 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Wikimedia Foundation |
| 5 | + * |
| 6 | + * LICENSE |
| 7 | + * |
| 8 | + * This program is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 19 | + */ |
| 20 | + |
| 21 | +/* |
| 22 | + * Include PHPUnit dependencies |
| 23 | + */ |
| 24 | +require_once 'PHPUnit/Framework/IncompleteTestError.php'; |
| 25 | +require_once 'PHPUnit/Framework/TestCase.php'; |
| 26 | +require_once 'PHPUnit/Framework/TestSuite.php'; |
| 27 | +require_once 'PHPUnit/Runner/Version.php'; |
| 28 | +require_once 'PHPUnit/TextUI/TestRunner.php'; |
| 29 | +require_once 'PHPUnit/Util/Filter.php'; |
| 30 | + |
| 31 | +/* |
| 32 | + * This file contains custom options and constants for test configuration. |
| 33 | + */ |
| 34 | + |
| 35 | +/** |
| 36 | + * TESTS_MESSAGE_NOT_IMPLEMENTED |
| 37 | + * |
| 38 | + * Message for code that has not been implemented. |
| 39 | + */ |
| 40 | +define( 'TESTS_MESSAGE_NOT_IMPLEMENTED', 'Not implemented yet!' ); |
| 41 | + |
| 42 | +/** |
| 43 | + * TESTS_HOSTNAME |
| 44 | + * |
| 45 | + * The hostname for the system |
| 46 | + */ |
| 47 | +define( 'TESTS_HOSTNAME', 'localhost' ); |
| 48 | + |
| 49 | +/** |
| 50 | + * TESTS_EMAIL |
| 51 | + * |
| 52 | + * An email address to use in case test send mail |
| 53 | + */ |
| 54 | +define( 'TESTS_EMAIL', 'no-reply@example.org' ); |
| 55 | + |
Index: trunk/extensions/UnitTest/tests/AllTests.php |
— | — | @@ -0,0 +1,63 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Wikimedia Foundation |
| 5 | + * |
| 6 | + * LICENSE |
| 7 | + * |
| 8 | + * This program is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 19 | + */ |
| 20 | + |
| 21 | +/** |
| 22 | + * Test helper |
| 23 | + */ |
| 24 | +require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'TestHelper.php'; |
| 25 | + |
| 26 | +/** |
| 27 | + * UnitTest_AllTests |
| 28 | + */ |
| 29 | +require_once dirname( __FILE__ ) . '/UnitTest/AllTests.php'; |
| 30 | + |
| 31 | +/** |
| 32 | + * AllTests |
| 33 | + */ |
| 34 | +class AllTests |
| 35 | +{ |
| 36 | + |
| 37 | + /** |
| 38 | + * Run the main test and load any parameters if needed. |
| 39 | + * |
| 40 | + */ |
| 41 | + public static function main() |
| 42 | + { |
| 43 | + $parameters = array(); |
| 44 | + |
| 45 | + PHPUnit_TextUI_TestRunner::run( self::suite(), $parameters ); |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * Run test suites |
| 50 | + * |
| 51 | + * @return PHPUnit_Framework_TestSuite |
| 52 | + */ |
| 53 | + public static function suite() |
| 54 | + { |
| 55 | + |
| 56 | + $suite = new PHPUnit_Framework_TestSuite( 'AllTests Suite' ); |
| 57 | + |
| 58 | + // This is the class name of a test suite |
| 59 | + $suite->addTestSuite( 'UnitTest_AllTests' ); |
| 60 | + |
| 61 | + return $suite; |
| 62 | + } |
| 63 | +} |
| 64 | + |
Property changes on: trunk/extensions/UnitTest/tests/AllTests.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 65 | + native |
Added: svn:mime-type |
2 | 66 | + text/plain |
Added: svn:keywords |
3 | 67 | + Author Date HeadURL Header Id Revision |
Index: trunk/extensions/UnitTest/tests/UnitTestTestCase.php |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Wikimedia Foundation |
| 5 | + * |
| 6 | + * LICENSE |
| 7 | + * |
| 8 | + * This program is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 19 | + */ |
| 20 | + |
| 21 | +/** |
| 22 | + * @file TestHelper.php |
| 23 | + */ |
| 24 | +require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'TestHelper.php'; |
| 25 | + |
| 26 | +/** |
| 27 | + * @see ExtensionsTestCase |
| 28 | + */ |
| 29 | +require_once dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'ExtensionsTestCase.php'; |
| 30 | + |
| 31 | +/** |
| 32 | + * UnitTestTestCase |
| 33 | + * |
| 34 | + * Abstract PHPUnit testing class |
| 35 | + * |
| 36 | + * Extend this class for the extension UnitTest. |
| 37 | + */ |
| 38 | +abstract class UnitTestTestCase extends ExtensionsTestCase |
| 39 | +{ |
| 40 | +} |
Property changes on: trunk/extensions/UnitTest/tests/UnitTestTestCase.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 41 | + native |
Added: svn:mime-type |
2 | 42 | + text/plain |
Added: svn:keywords |
3 | 43 | + Author Date HeadURL Header Id Revision |
Index: trunk/extensions/UnitTest/tests/UnitTestSeleniumTestCase.php |
— | — | @@ -0,0 +1,81 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Wikimedia Foundation |
| 5 | + * |
| 6 | + * LICENSE |
| 7 | + * |
| 8 | + * This program is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 19 | + */ |
| 20 | + |
| 21 | +/** |
| 22 | + * @see TestHelper.php |
| 23 | + */ |
| 24 | +require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'TestHelper.php'; |
| 25 | + |
| 26 | +/** |
| 27 | + * @see ExtensionsSeleniumTestCase |
| 28 | + */ |
| 29 | +require_once dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'ExtensionsSeleniumTestCase.php'; |
| 30 | + |
| 31 | +/** |
| 32 | + * UnitTestSeleniumTestCase |
| 33 | + * |
| 34 | + * Abstract Selenium testing class |
| 35 | + * |
| 36 | + * Extend this class for the extension UnitTest. |
| 37 | + */ |
| 38 | +abstract class UnitTestSeleniumTestCase extends ExtensionsSeleniumTestCase |
| 39 | +{ |
| 40 | + public static $browsers = array( |
| 41 | + array( |
| 42 | + 'name' => 'Firefox on Mac', |
| 43 | + 'browser' => '*firefox /Applications/Firefox.app/Contents/MacOS/firefox-bin', |
| 44 | + 'host' => 'localhost', |
| 45 | + 'port' => 4444, |
| 46 | + 'timeout' => 30000, |
| 47 | + ) |
| 48 | + ); |
| 49 | + |
| 50 | + /** |
| 51 | + * setExtensionName |
| 52 | + * |
| 53 | + * Set the extension name |
| 54 | + * |
| 55 | + * @see $extensionName |
| 56 | + */ |
| 57 | + protected function setExtensionName() |
| 58 | + { |
| 59 | + $this->extensionName = 'UnitTest'; |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Set unitTestBasePath |
| 64 | + * |
| 65 | + * Implement this prototype with the following line: |
| 66 | + * |
| 67 | + * @example $this->unitTestBasePath = realpath( dirname( dirname( __FILE__ ) ) ); |
| 68 | + * |
| 69 | + */ |
| 70 | + protected function setUnitTestBasePath() |
| 71 | + { |
| 72 | + $this->unitTestBasePath = realpath( dirname( __FILE__ ) ); |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * Test Selenese files |
| 77 | + */ |
| 78 | + public function testSelenese() |
| 79 | + { |
| 80 | + $this->runSeleneseFiles(); |
| 81 | + } |
| 82 | +} |
Property changes on: trunk/extensions/UnitTest/tests/UnitTestSeleniumTestCase.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 83 | + native |
Added: svn:mime-type |
2 | 84 | + text/plain |
Added: svn:keywords |
3 | 85 | + Author Date HeadURL Header Id Revision |
Index: trunk/extensions/UnitTest/tests/TestHelper.php |
— | — | @@ -0,0 +1,89 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Wikimedia Foundation |
| 5 | + * |
| 6 | + * LICENSE |
| 7 | + * |
| 8 | + * This program is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 19 | + */ |
| 20 | + |
| 21 | +/* |
| 22 | + * Set error reporting to the level to which code must comply. |
| 23 | + */ |
| 24 | +error_reporting( E_ALL | E_STRICT ); |
| 25 | + |
| 26 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 27 | + define( 'MEDIAWIKI', 1 ); |
| 28 | +} |
| 29 | + |
| 30 | +/** |
| 31 | + * TESTS_UNITTEST_EXTENSION_ROOT |
| 32 | + * |
| 33 | + * This is the root of the extension UnitTest |
| 34 | + */ |
| 35 | +define( 'TESTS_UNITTEST_EXTENSION_ROOT', dirname( dirname( __FILE__ ) ) ); |
| 36 | + |
| 37 | +//$IP = TESTS_WEB_ROOT; |
| 38 | + |
| 39 | +/* |
| 40 | + * Unit tests are run from the command line. |
| 41 | + * |
| 42 | + * It should be confirmed that this will not affect other tests such as Selenium. |
| 43 | + */ |
| 44 | +$wgCommandLineMode = true; |
| 45 | +//$wgCanonicalServer = true; |
| 46 | + |
| 47 | +/** |
| 48 | + * Initializing the global $_SERVER for unit testing. This array does not exist |
| 49 | + * on the CLI. |
| 50 | + * |
| 51 | + * You may customize this variable in TestConfiguration.php. |
| 52 | + * |
| 53 | + * @var array $_SERVER |
| 54 | + */ |
| 55 | +$_SERVER = array ( 'HTTP_HOST' => 'localhost', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1', 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_CONNECTION' => 'keep-alive', 'HTTP_COOKIE' => 'mediawiki_fundraising_117_session=f2rc8vv6av1o324qodvinqlpi1', 'HTTP_IF_MODIFIED_SINCE' => 'Fri, 14 Oct 2011 20:18:45 GMT', 'PATH' => '/usr/bin:/bin:/usr/sbin:/sbin', 'SERVER_SIGNATURE' => ' |
| 56 | +Apache/2.2.19 (Unix) DAV/2 PHP/5.3.7 Server at localhost Port 80 |
| 57 | +', 'SERVER_SOFTWARE' => 'Apache/2.2.19 (Unix) DAV/2 PHP/5.3.7', 'SERVER_NAME' => 'localhost', 'SERVER_ADDR' => '127.0.0.1', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '127.0.0.1', 'DOCUMENT_ROOT' => '/dev/null', 'SERVER_ADMIN' => 'no-reply@example.org', 'SCRIPT_FILENAME' => '/dev/null/index.php', 'REMOTE_PORT' => '62747', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME' => 1318890010, ); |
| 58 | + |
| 59 | +// Initialize session for unit testing |
| 60 | +$_SESSION = isset( $_SESSION ) ? $_SESSION : array(); |
| 61 | + |
| 62 | +/* |
| 63 | + * Required files for unit testing. |
| 64 | + * |
| 65 | + * These files need to be required after the above code. Do not move. |
| 66 | + */ |
| 67 | + |
| 68 | +/** |
| 69 | + * Constants used by the debugging statements. |
| 70 | + */ |
| 71 | +require_once dirname( dirname( __FILE__ ) ) . '/Debug.php'; |
| 72 | + |
| 73 | +/* |
| 74 | + * Load the user-defined test configuration file, if it exists; otherwise, load |
| 75 | + * the default configuration. |
| 76 | + */ |
| 77 | +if ( is_file( 'TestConfiguration.php' ) ) { |
| 78 | + require_once 'TestConfiguration.php'; |
| 79 | +} else { |
| 80 | + require_once 'TestConfiguration.php.dist'; |
| 81 | +} |
| 82 | + |
| 83 | +/* |
| 84 | + * Customize the server variable options. |
| 85 | + */ |
| 86 | +$_SERVER['HTTP_HOST'] = TESTS_HOSTNAME; |
| 87 | +$_SERVER['SERVER_NAME'] = TESTS_HOSTNAME; |
| 88 | +//$_SERVER['SERVER_NAME'] = TESTS_WEB_ROOT; |
| 89 | +$_SERVER['SERVER_ADMIN'] = TESTS_EMAIL; |
| 90 | + |
Property changes on: trunk/extensions/UnitTest/tests/TestHelper.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 91 | + native |
Added: svn:mime-type |
2 | 92 | + text/plain |
Added: svn:keywords |
3 | 93 | + Author Date HeadURL Header Id Revision |
Index: trunk/extensions/UnitTest/tests/unittest.conf.dist |
— | — | @@ -0,0 +1,116 @@ |
| 2 | +#!/bin/sh |
| 3 | +################################################################################ |
| 4 | +# |
| 5 | +# Wikimedia Foundation |
| 6 | +# |
| 7 | +# LICENSE |
| 8 | +# |
| 9 | +# This program is free software; you can redistribute it and/or modify |
| 10 | +# it under the terms of the GNU General Public License as published by |
| 11 | +# the Free Software Foundation; either version 2 of the License, or |
| 12 | +# (at your option) any later version. |
| 13 | +# |
| 14 | +# This program is distributed in the hope that it will be useful, |
| 15 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | +# GNU General Public License for more details. |
| 18 | +# |
| 19 | +# @license http://www.gnu.org/copyleft/gpl.html GNU GENERAL PUBLIC LICENSE |
| 20 | +# @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 21 | +# |
| 22 | +################################################################################ |
| 23 | +# |
| 24 | +# This is the distributed configuration file. If you need to make changes to |
| 25 | +# these settings, copy this file to this directory and remove the ".dist" |
| 26 | +# extension. |
| 27 | +# |
| 28 | +################################################################################ |
| 29 | +# |
| 30 | +# @var string $UNITTEST_HOSTNAME The hostname to the webserver. |
| 31 | +# |
| 32 | +: ${UNITTEST_HOSTNAME:="localhost"} |
| 33 | +# |
| 34 | +# @var string $UNITTEST_URL The url to the webserver. You need the trailing |
| 35 | +# slash. |
| 36 | +# |
| 37 | +: ${UNITTEST_URL:="http://localhost/extensions/UnitTest/tests/"} |
| 38 | +# |
| 39 | +# @var string $PHPUNIT If phpunit.php is not within your shell $PATH, you may |
| 40 | +# specify the full path here. |
| 41 | +# |
| 42 | +: ${PHPUNIT:="phpunit.php"} |
| 43 | +# |
| 44 | +# @var string $PHPUNIT_OPTS By default, all testing will be run in verbose mode. |
| 45 | +# |
| 46 | +: ${PHPUNIT_OPTS:="--verbose"} |
| 47 | +# |
| 48 | +# @var string $PHPUNIT_LIST_GROUPS Specify the relative path to the file in |
| 49 | +# which you want to list groups designated by the doctag @group |
| 50 | +# |
| 51 | +: ${PHPUNIT_LIST_GROUPS:"=AllTests.php"} |
| 52 | +# |
| 53 | +# @var string $PHPUNIT_FILE Specify the relative path to the test in which you |
| 54 | +# want to run. You need to omit the ".php" extension. |
| 55 | +# |
| 56 | +: ${PHPUNIT_FILE:="AllTests"} |
| 57 | +# |
| 58 | +# @var string $PHPUNIT_COVERAGE_HTML The relative path to the code coverage |
| 59 | +# html directory |
| 60 | +# |
| 61 | +# This is where code coverage will be saved if the flag -ch is passed. If you wish to specify a full path, use: |
| 62 | +# --coverage-html "/some/absolute/path" |
| 63 | +# |
| 64 | +# These directories will need to exist, they will not be created. |
| 65 | +# |
| 66 | +: ${PHPUNIT_COVERAGE_HTML:="logs/coverage/html"} |
| 67 | +# |
| 68 | +# @var string $PHPUNIT_COVERAGE_CLOVER The relative path to the code coverage |
| 69 | +# clover directory |
| 70 | +# |
| 71 | +# This is where code coverage will be saved if the flag -ch is passed. If you wish to specify a full path, use: |
| 72 | +# --coverage-clover "/some/absolute/path" |
| 73 | +# |
| 74 | +# These directories will need to exist, they will not be created. |
| 75 | +# |
| 76 | +: ${PHPUNIT_COVERAGE_CLOVER:="logs/coverage/clover/index.xml"} |
| 77 | +# |
| 78 | +# @var string $PHPUNIT_TESTDOX_HTML The relative path to the testdox output html |
| 79 | +# directory. It is okay to put this the same directory as html coverage. |
| 80 | +# |
| 81 | +# This is where testdox will be saved if the flag -tdh is passed. If you wish to specify a full path, use: |
| 82 | +# --testdox-html "/some/absolute/path" |
| 83 | +# |
| 84 | +# These directories will need to exist, they will not be created. |
| 85 | +# |
| 86 | +: ${PHPUNIT_TESTDOX_HTML:="logs/coverage/html/testdox.html"} |
| 87 | +# |
| 88 | +# @var string $PHPUNIT_LOG_JSON The relative path to the log output json |
| 89 | +# directory. |
| 90 | +# |
| 91 | +# This is where log.json will be saved if the flag -ljs is passed. If you wish to specify a full path, use: |
| 92 | +# --log-json "/some/absolute/path" |
| 93 | +# |
| 94 | +# These directories will need to exist, they will not be created. |
| 95 | +# |
| 96 | +: ${PHPUNIT_LOG_JSON:="logs/coverage/results/log.json"} |
| 97 | +# |
| 98 | +# @var string $PHPUNIT_LOG_JUNIT The relative path to the log output junit |
| 99 | +# directory. |
| 100 | +# |
| 101 | +# This is where log.xml will be saved if the flag -lju is passed. If you wish to specify a full path, use: |
| 102 | +# --log-junit "/some/absolute/path" |
| 103 | +# |
| 104 | +# These directories will need to exist, they will not be created. |
| 105 | +# |
| 106 | +: ${PHPUNIT_LOG_JUNIT:="logs/coverage/results/log.xml"} |
| 107 | +# |
| 108 | +# @var string $PHPUNIT_LOG_TAP The relative path to the log output tap |
| 109 | +# directory. |
| 110 | +# |
| 111 | +# This is where log.tap will be saved if the flag -ljs is passed. If you wish to specify a full path, use: |
| 112 | +# --log-tap "/some/absolute/path" |
| 113 | +# |
| 114 | +# These directories will need to exist, they will not be created. |
| 115 | +# |
| 116 | +: ${PHPUNIT_LOG_TAP:="logs/coverage/results/log.tap"} |
| 117 | + |
Index: trunk/extensions/UnitTest/tests/phpunit.xml |
— | — | @@ -0,0 +1,46 @@ |
| 2 | +<phpunit bootstrap="TestHelper.php"> |
| 3 | + <filter> |
| 4 | + <blacklist> |
| 5 | + <directory>../resources</directory> |
| 6 | + <directory>../tests</directory> |
| 7 | + <directory>../tools</directory> |
| 8 | + </blacklist> |
| 9 | + <whitelist> |
| 10 | + <directory suffix=".php">../special</directory> |
| 11 | + <exclude> |
| 12 | + </exclude> |
| 13 | + </whitelist> |
| 14 | + </filter> |
| 15 | + <selenium> |
| 16 | + <!-- Choose a browser to run for testing and uncomment it. --> |
| 17 | + |
| 18 | + <!-- You may need to alter the parameters for your browser. --> |
| 19 | + |
| 20 | + <!-- Chrome --> |
| 21 | + |
| 22 | + <!-- |
| 23 | + <browser name="Chrome on Mac" browser="*chrome /Applications/Google Chrome.app/Contents/MacOS/Google Chrome" host="localhost" port="4444" timeout="30000"/> |
| 24 | + --> |
| 25 | + |
| 26 | + <!-- Firefox --> |
| 27 | + |
| 28 | + <!-- |
| 29 | + <browser name="Firefox on Linux" browser="*firefox /usr/lib/firefox/firefox-bin" host="localhost" port="4444" timeout="30000"/> |
| 30 | + <browser name="Firefox on Mac" browser="*firefox /Applications/Firefox.app/Contents/MacOS/firefox-bin" host="localhost" port="4444" timeout="30000"/> |
| 31 | + <browser name="Firefox on Windows XP" browser="*firefox C:\Program Files\Mozilla Firefox\firefox.exe" host="localhost" port="4444" timeout="30000"/> |
| 32 | + --> |
| 33 | + |
| 34 | + <!-- Internet Explorer --> |
| 35 | + |
| 36 | + <!-- |
| 37 | + <browser name="IE on Windows XP" browser="*iexplore" host="localhost" port="4444" timeout="30000"/> |
| 38 | + --> |
| 39 | + |
| 40 | + <!-- Safari --> |
| 41 | + |
| 42 | + <!-- |
| 43 | + <browser name="Safari on Mac" browser="*safari /Applications/Safari.app/Contents/MacOS/Safari" host="localhost" port="4444" timeout="30000"/> |
| 44 | + <browser name="Safari on Windows XP" browser="**custom C:\Program Files\Safari\Safari.exe -url" host="localhost" port="4444" timeout="30000"/> |
| 45 | + --> |
| 46 | + </selenium> |
| 47 | +</phpunit> |
\ No newline at end of file |
Property changes on: trunk/extensions/UnitTest/tests/phpunit.xml |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 48 | + native |
Added: svn:mime-type |
2 | 49 | + text/xml |
Added: svn:keywords |
3 | 50 | + Author Date HeadURL Header Id Revision |
Index: trunk/extensions/UnitTest/tests/selenium.ini.dst |
— | — | @@ -0,0 +1,46 @@ |
| 2 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 3 | +; |
| 4 | +; This is the distributed configuration file for selenium and the extension |
| 5 | +; CentralNotice. |
| 6 | +; |
| 7 | +; Do not edit this file. If you would like to make changes, copy this file to |
| 8 | +; the same directory, removing the .dst extension: |
| 9 | +; |
| 10 | +; cp selenium.ini.dst selenium.ini |
| 11 | +; |
| 12 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 13 | +; |
| 14 | +; selenium |
| 15 | +; |
| 16 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 17 | +[selenium] |
| 18 | +; |
| 19 | +; Screenshots are enabled by default |
| 20 | +; |
| 21 | +screenshots = yes |
| 22 | +; |
| 23 | +; Capture screenshots after assertion is enabled by default |
| 24 | +; |
| 25 | +screenshotAfterAssertion = yes |
| 26 | +; |
| 27 | +; Load selenese |
| 28 | +; |
| 29 | +selenese = yes |
| 30 | + |
| 31 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 32 | +; |
| 33 | +; host |
| 34 | +; |
| 35 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 36 | +[host] |
| 37 | +;hostname = "localhost" |
| 38 | +hostname = "wikimedia-commit.localhost.wikimedia.org" |
| 39 | +;browserUrl = "http://localhost/" |
| 40 | +browserUrl = "http://wikimedia-commit.localhost.wikimedia.org/" |
| 41 | + |
| 42 | +[credentials] |
| 43 | +admin[username] = "admin" |
| 44 | +admin[password] = "mediawiki" |
| 45 | + |
| 46 | +user[username] = "user" |
| 47 | +user[password] = "mediawiki" |
Index: trunk/extensions/UnitTest/tests/unittest.sh |
— | — | @@ -0,0 +1 @@ |
| 2 | +link ../tools/tests-template/unittest.sh |
\ No newline at end of file |
Property changes on: trunk/extensions/UnitTest/tests/unittest.sh |
___________________________________________________________________ |
Added: svn:special |
1 | 3 | + * |
Index: trunk/extensions/UnitTest/tests/TestConfiguration.php |
— | — | @@ -0,0 +1,54 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Wikimedia Foundation |
| 5 | + * |
| 6 | + * LICENSE |
| 7 | + * |
| 8 | + * This program is free software; you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation; either version 2 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
| 19 | + */ |
| 20 | + |
| 21 | +/* |
| 22 | + * Include PHPUnit dependencies |
| 23 | + */ |
| 24 | +require_once 'PHPUnit/Framework/IncompleteTestError.php'; |
| 25 | +require_once 'PHPUnit/Framework/TestCase.php'; |
| 26 | +require_once 'PHPUnit/Framework/TestSuite.php'; |
| 27 | +require_once 'PHPUnit/Runner/Version.php'; |
| 28 | +require_once 'PHPUnit/TextUI/TestRunner.php'; |
| 29 | +require_once 'PHPUnit/Util/Filter.php'; |
| 30 | + |
| 31 | +/* |
| 32 | + * This file contains custom options and constants for test configuration. |
| 33 | + */ |
| 34 | + |
| 35 | +/** |
| 36 | + * TESTS_MESSAGE_NOT_IMPLEMENTED |
| 37 | + * |
| 38 | + * Message for code that has not been implemented. |
| 39 | + */ |
| 40 | +define( 'TESTS_MESSAGE_NOT_IMPLEMENTED', 'Not implemented yet!' ); |
| 41 | + |
| 42 | +/** |
| 43 | + * TESTS_HOSTNAME |
| 44 | + * |
| 45 | + * The hostname for the system |
| 46 | + */ |
| 47 | +define( 'TESTS_HOSTNAME', 'localhost' ); |
| 48 | + |
| 49 | +/** |
| 50 | + * TESTS_EMAIL |
| 51 | + * |
| 52 | + * An email address to use in case test send mail |
| 53 | + */ |
| 54 | +define( 'TESTS_EMAIL', 'no-reply@example.org' ); |
| 55 | + |
Property changes on: trunk/extensions/UnitTest/tests/TestConfiguration.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 56 | + native |
Added: svn:mime-type |
2 | 57 | + text/plain |
Added: svn:keywords |
3 | 58 | + Author Date HeadURL Header Id Revision |
Property changes on: trunk/extensions/UnitTest/tests |
___________________________________________________________________ |
Added: svn:ignore |
4 | 59 | + TestConfiguration.php |
selenium.ini |
unittest.conf |