MediaWiki REL1_33
MediaWikiTestCaseSchema1Test.php
Go to the documentation of this file.
1<?php
3
11
12 public static $hasRun = false;
13
14 public function setUp() {
15 parent::setUp();
16 // FIXME: fails under postgres
17 $this->markTestSkippedIfDbType( 'postgres' );
18 }
19
21 return [
22 'create' => [ 'MediaWikiTestCaseTestTable', 'imagelinks' ],
23 'drop' => [ 'oldimage' ],
24 'alter' => [ 'pagelinks' ],
25 'scripts' => [ __DIR__ . '/MediaWikiTestCaseSchemaTest.sql' ]
26 ];
27 }
28
30 // The test must be run before the second test
31 self::$hasRun = true;
32 $this->assertTrue( self::$hasRun );
33 }
34
35 public function testTableWasCreated() {
36 // Make sure MediaWikiTestCaseTestTable was created.
37 $this->assertTrue( $this->db->tableExists( 'MediaWikiTestCaseTestTable' ) );
38 }
39
40 public function testTableWasDropped() {
41 // Make sure oldimage was dropped
42 $this->assertFalse( $this->db->tableExists( 'oldimage' ) );
43 }
44
45 public function testTableWasOverriden() {
46 // Make sure imagelinks was overwritten
47 $this->assertTrue( $this->db->tableExists( 'imagelinks' ) );
48 $this->assertTrue( $this->db->fieldExists( 'imagelinks', 'il_frobnitz' ) );
49 }
50
51 public function testTableWasAltered() {
52 // Make sure pagelinks was altered
53 $this->assertTrue( $this->db->tableExists( 'pagelinks' ) );
54 $this->assertTrue( $this->db->fieldExists( 'pagelinks', 'pl_frobnitz' ) );
55 }
56
57}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
getSchemaOverrides(IMaintainableDatabase $db)
Stub.
Database $db
Primary database.
markTestSkippedIfDbType( $type)
Skip the test if using the specified database type.
Advanced database interface for IDatabase handles that include maintenance methods.