*/
class MediaWikiTestCaseSchema1Test extends MediaWikiTestCase {
+ public static $hasRun = false;
+
public function getSchemaOverrides() {
return [
[ 'imagelinks', 'MediaWikiTestCaseTestTable' ],
];
}
+ public function testMediaWikiTestCaseSchemaTestOrder() {
+ // The test must be run before the second test
+ self::$hasRun = true;
+ $this->assertTrue( self::$hasRun );
+ }
+
public function testSchemaExtension() {
// make sure we can use the MediaWikiTestCaseTestTable table
* that any schema modifications have been cleaned up between test cases.
* As there seems to be no way to force execution order, we currently rely on
* test classes getting run in anpha-numerical order.
+ * Order is checked by the testMediaWikiTestCaseSchemaTestOrder test in both classes.
*/
class MediaWikiTestCaseSchema2Test extends MediaWikiTestCase {
+ public function testMediaWikiTestCaseSchemaTestOrder() {
+ // The first test must have run before this one
+ $this->assertTrue( MediaWikiTestCaseSchema1Test::$hasRun );
+ }
+
public function testSchemaExtension() {
// Make sure MediaWikiTestCaseTestTable created by MediaWikiTestCaseSchema1Test
// was dropped before executing MediaWikiTestCaseSchema2Test.