Merge "Add semantic tags to license info text"
[lhc/web/wiklou.git] / tests / phpunit / tests / MediaWikiTestCaseSchema1Test.php
1 <?php
2
3 /**
4 * @covers MediaWikiTestCase
5 *
6 * @group Database
7 * @group MediaWikiTestCaseTest
8 */
9 class MediaWikiTestCaseSchema1Test extends MediaWikiTestCase {
10
11 public function getSchemaOverrides() {
12 return [
13 [ 'imagelinks', 'MediaWikiTestCaseTestTable' ],
14 [ __DIR__ . '/MediaWikiTestCaseSchemaTest.sql' ]
15 ];
16 }
17
18 public function testSchemaExtension() {
19 // make sure we can use the MediaWikiTestCaseTestTable table
20
21 $input = [ 'id' => '5', 'name' => 'Test' ];
22
23 $this->db->insert(
24 'MediaWikiTestCaseTestTable',
25 $input
26 );
27
28 $output = $this->db->selectRow( 'MediaWikiTestCaseTestTable', array_keys( $input ), [] );
29 $this->assertEquals( (object)$input, $output );
30 }
31
32 public function testSchemaOverride() {
33 // make sure we can use the il_frobniz field
34
35 $input = [
36 'il_from' => '7',
37 'il_from_namespace' => '0',
38 'il_to' => 'Foo.jpg',
39 'il_frobniz' => 'Xyzzy',
40 ];
41
42 $this->db->insert(
43 'imagelinks',
44 $input
45 );
46
47 $output = $this->db->selectRow( 'imagelinks', array_keys( $input ), [] );
48 $this->assertEquals( (object)$input, $output );
49 }
50
51 }