MediaWiki
REL1_31
MediaWikiTestCaseSchema1Test.php
Go to the documentation of this file.
1
<?php
2
use
Wikimedia\Rdbms\IMaintainableDatabase
;
3
10
class
MediaWikiTestCaseSchema1Test
extends
MediaWikiTestCase
{
11
12
public
static
$hasRun
=
false
;
13
14
public
function
getSchemaOverrides
(
IMaintainableDatabase
$db
) {
15
return
[
16
'create'
=> [
'MediaWikiTestCaseTestTable'
,
'imagelinks'
],
17
'drop'
=> [
'oldimage'
],
18
'alter'
=> [
'pagelinks'
],
19
'scripts'
=> [ __DIR__ .
'/MediaWikiTestCaseSchemaTest.sql'
]
20
];
21
}
22
23
public
function
testMediaWikiTestCaseSchemaTestOrder
() {
24
// The test must be run before the second test
25
self::$hasRun =
true
;
26
$this->assertTrue( self::$hasRun );
27
}
28
29
public
function
testTableWasCreated
() {
30
// Make sure MediaWikiTestCaseTestTable was created.
31
$this->assertTrue( $this->db->tableExists(
'MediaWikiTestCaseTestTable'
) );
32
}
33
34
public
function
testTableWasDropped
() {
35
// Make sure oldimage was dropped
36
$this->assertFalse( $this->db->tableExists(
'oldimage'
) );
37
}
38
39
public
function
testTableWasOverriden
() {
40
// Make sure imagelinks was overwritten
41
$this->assertTrue( $this->db->tableExists(
'imagelinks'
) );
42
$this->assertTrue( $this->db->fieldExists(
'imagelinks'
,
'il_frobnitz'
) );
43
}
44
45
public
function
testTableWasAltered
() {
46
// Make sure pagelinks was altered
47
$this->assertTrue( $this->db->tableExists(
'pagelinks'
) );
48
$this->assertTrue( $this->db->fieldExists(
'pagelinks'
,
'pl_frobnitz'
) );
49
}
50
51
}
MediaWikiTestCaseSchema1Test
MediaWikiTestCase.
Definition
MediaWikiTestCaseSchema1Test.php:10
MediaWikiTestCaseSchema1Test\testTableWasDropped
testTableWasDropped()
Definition
MediaWikiTestCaseSchema1Test.php:34
MediaWikiTestCaseSchema1Test\$hasRun
static $hasRun
Definition
MediaWikiTestCaseSchema1Test.php:12
MediaWikiTestCaseSchema1Test\testMediaWikiTestCaseSchemaTestOrder
testMediaWikiTestCaseSchemaTestOrder()
Definition
MediaWikiTestCaseSchema1Test.php:23
MediaWikiTestCaseSchema1Test\testTableWasAltered
testTableWasAltered()
Definition
MediaWikiTestCaseSchema1Test.php:45
MediaWikiTestCaseSchema1Test\testTableWasCreated
testTableWasCreated()
Definition
MediaWikiTestCaseSchema1Test.php:29
MediaWikiTestCaseSchema1Test\testTableWasOverriden
testTableWasOverriden()
Definition
MediaWikiTestCaseSchema1Test.php:39
MediaWikiTestCaseSchema1Test\getSchemaOverrides
getSchemaOverrides(IMaintainableDatabase $db)
Stub.
Definition
MediaWikiTestCaseSchema1Test.php:14
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
MediaWikiTestCase\$db
Database $db
Primary database.
Definition
MediaWikiTestCase.php:57
Wikimedia\Rdbms\IMaintainableDatabase
Advanced database interface for IDatabase handles that include maintenance methods.
Definition
IMaintainableDatabase.php:38
tests
phpunit
tests
MediaWikiTestCaseSchema1Test.php
Generated on Mon Nov 25 2024 15:36:45 for MediaWiki by
1.10.0