X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Ftests%2FMediaWikiTestCaseSchema2Test.php;h=5464dc43f814475046aa0eb1d3584f1826d43ce3;hp=74f053eb3ed176fa74333cbe6f141b72b7351b40;hb=9b670fb797813a8ed35750e2c83fe953a10f349e;hpb=7babd362babcbf7f20adb8e12edb4f4bc1d4249f diff --git a/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php b/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php index 74f053eb3e..5464dc43f8 100644 --- a/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php +++ b/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php @@ -19,17 +19,30 @@ class MediaWikiTestCaseSchema2Test extends MediaWikiTestCase { $this->assertTrue( MediaWikiTestCaseSchema1Test::$hasRun ); } - public function testSchemaExtension() { + public function testCreatedTableWasRemoved() { // Make sure MediaWikiTestCaseTestTable created by MediaWikiTestCaseSchema1Test // was dropped before executing MediaWikiTestCaseSchema2Test. $this->assertFalse( $this->db->tableExists( 'MediaWikiTestCaseTestTable' ) ); } - public function testSchemaOverride() { - // Make sure imagelinks modified by MediaWikiTestCaseSchema1Test + public function testDroppedTableWasRestored() { + // Make sure oldimage that was dropped by MediaWikiTestCaseSchema1Test + // was restored before executing MediaWikiTestCaseSchema2Test. + $this->assertTrue( $this->db->tableExists( 'oldimage' ) ); + } + + public function testOverridenTableWasRestored() { + // Make sure imagelinks overwritten by MediaWikiTestCaseSchema1Test // was restored to the original schema before executing MediaWikiTestCaseSchema2Test. $this->assertTrue( $this->db->tableExists( 'imagelinks' ) ); - $this->assertFalse( $this->db->fieldExists( 'imagelinks', 'il_frobniz' ) ); + $this->assertFalse( $this->db->fieldExists( 'imagelinks', 'il_frobnitz' ) ); + } + + public function testAlteredTableWasRestored() { + // Make sure pagelinks altered by MediaWikiTestCaseSchema1Test + // was restored to the original schema before executing MediaWikiTestCaseSchema2Test. + $this->assertTrue( $this->db->tableExists( 'pagelinks' ) ); + $this->assertFalse( $this->db->fieldExists( 'pagelinks', 'pl_frobnitz' ) ); } }