4 * @covers MediaWikiTestCase
7 * @group MediaWikiTestCaseTest
9 class MediaWikiTestCaseSchema1Test
extends MediaWikiTestCase
{
11 public static $hasRun = false;
13 public function getSchemaOverrides() {
15 [ 'imagelinks', 'MediaWikiTestCaseTestTable' ],
16 [ __DIR__
. '/MediaWikiTestCaseSchemaTest.sql' ]
20 public function testMediaWikiTestCaseSchemaTestOrder() {
21 // The test must be run before the second test
23 $this->assertTrue( self
::$hasRun );
26 public function testSchemaExtension() {
27 // make sure we can use the MediaWikiTestCaseTestTable table
29 $input = [ 'id' => '5', 'name' => 'Test' ];
32 'MediaWikiTestCaseTestTable',
36 $output = $this->db
->selectRow( 'MediaWikiTestCaseTestTable', array_keys( $input ), [] );
37 $this->assertEquals( (object)$input, $output );
40 public function testSchemaOverride() {
41 // make sure we can use the il_frobniz field
45 'il_from_namespace' => '0',
47 'il_frobniz' => 'Xyzzy',
55 $output = $this->db
->selectRow( 'imagelinks', array_keys( $input ), [] );
56 $this->assertEquals( (object)$input, $output );