MediaWiki  1.33.0
MediaWikiTestCaseSchema2Test.php
Go to the documentation of this file.
1 <?php
2 
16 
17  public function setUp() {
18  parent::setUp();
19  // FIXME: fails under postgres
20  $this->markTestSkippedIfDbType( 'postgres' );
21  }
22 
24  // The first test must have run before this one
25  $this->assertTrue( MediaWikiTestCaseSchema1Test::$hasRun );
26  }
27 
28  public function testCreatedTableWasRemoved() {
29  // Make sure MediaWikiTestCaseTestTable created by MediaWikiTestCaseSchema1Test
30  // was dropped before executing MediaWikiTestCaseSchema2Test.
31  $this->assertFalse( $this->db->tableExists( 'MediaWikiTestCaseTestTable' ) );
32  }
33 
34  public function testDroppedTableWasRestored() {
35  // Make sure oldimage that was dropped by MediaWikiTestCaseSchema1Test
36  // was restored before executing MediaWikiTestCaseSchema2Test.
37  $this->assertTrue( $this->db->tableExists( 'oldimage' ) );
38  }
39 
40  public function testOverridenTableWasRestored() {
41  // Make sure imagelinks overwritten by MediaWikiTestCaseSchema1Test
42  // was restored to the original schema before executing MediaWikiTestCaseSchema2Test.
43  $this->assertTrue( $this->db->tableExists( 'imagelinks' ) );
44  $this->assertFalse( $this->db->fieldExists( 'imagelinks', 'il_frobnitz' ) );
45  }
46 
47  public function testAlteredTableWasRestored() {
48  // Make sure pagelinks altered by MediaWikiTestCaseSchema1Test
49  // was restored to the original schema before executing MediaWikiTestCaseSchema2Test.
50  $this->assertTrue( $this->db->tableExists( 'pagelinks' ) );
51  $this->assertFalse( $this->db->fieldExists( 'pagelinks', 'pl_frobnitz' ) );
52  }
53 
54 }
MediaWikiTestCaseSchema1Test\$hasRun
static $hasRun
Definition: MediaWikiTestCaseSchema1Test.php:12
MediaWikiTestCaseSchema2Test\testDroppedTableWasRestored
testDroppedTableWasRestored()
Definition: MediaWikiTestCaseSchema2Test.php:34
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
MediaWikiTestCaseSchema2Test\setUp
setUp()
Definition: MediaWikiTestCaseSchema2Test.php:17
MediaWikiTestCaseSchema2Test
MediaWikiTestCase.
Definition: MediaWikiTestCaseSchema2Test.php:15
MediaWikiTestCase
Definition: MediaWikiTestCase.php:17
MediaWikiTestCaseSchema2Test\testMediaWikiTestCaseSchemaTestOrder
testMediaWikiTestCaseSchemaTestOrder()
Definition: MediaWikiTestCaseSchema2Test.php:23
MediaWikiTestCaseSchema2Test\testAlteredTableWasRestored
testAlteredTableWasRestored()
Definition: MediaWikiTestCaseSchema2Test.php:47
MediaWikiTestCaseSchema2Test\testCreatedTableWasRemoved
testCreatedTableWasRemoved()
Definition: MediaWikiTestCaseSchema2Test.php:28
MediaWikiTestCaseSchema2Test\testOverridenTableWasRestored
testOverridenTableWasRestored()
Definition: MediaWikiTestCaseSchema2Test.php:40
MediaWikiTestCase\markTestSkippedIfDbType
markTestSkippedIfDbType( $type)
Skip the test if using the specified database type.
Definition: MediaWikiTestCase.php:2303