~ubuntu-branches/ubuntu/trusty/mediawiki/trusty

« back to all changes in this revision

Viewing changes to tests/phpunit/suites/ExtensionsTestSuite.php

  • Committer: Package Import Robot
  • Author(s): Thorsten Glaser
  • Date: 2014-03-28 09:56:29 UTC
  • mfrom: (1.3.14)
  • Revision ID: package-import@ubuntu.com-20140328095629-1526y9tchdd507id
Tags: 1:1.19.14+dfsg-1
* New upstream security fix release (Closes: #742857):
  - (bug 62497) SECURITY: Add CSRF token on Special:ChangePassword
  - (bug 62467) Set a title for the context during import on the cli
* Use upstream-provided signing key bundle

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php 
 
2
/**
 
3
 * This test suite runs unit tests registered by extensions.
 
4
 * See http://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList for details of how to register your tests.
 
5
 */
 
6
 
 
7
class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
 
8
        public function __construct() {
 
9
                parent::__construct();
 
10
                $files = array();
 
11
                wfRunHooks( 'UnitTestsList', array( &$files ) );
 
12
                foreach ( $files as $file ) {
 
13
                        $this->addTestFile( $file );
 
14
                }
 
15
                if ( !count( $files ) ) {
 
16
                        $this->addTest( new DummyExtensionsTest( 'testNothing' ) );
 
17
                }
 
18
        }
 
19
 
 
20
        public static function suite() {
 
21
                return new self;
 
22
        }
 
23
}
 
24
 
 
25
/**
 
26
 * Needed to avoid warnings like 'No tests found in class "ExtensionsTestSuite".'
 
27
 * when no extensions with tests are used.
 
28
 */
 
29
class DummyExtensionsTest extends MediaWikiTestCase {
 
30
        public function testNothing() {
 
31
                $this->assertTrue( true );
 
32
        }
 
33
}