Page MenuHomeWickedGov Phorge

MediaWikiIntegrationTestCaseSchema1Test.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

MediaWikiIntegrationTestCaseSchema1Test.php

<?php
use Wikimedia\Rdbms\IMaintainableDatabase;
/**
* @covers \MediaWikiIntegrationTestCase
* @group Database
*/
class MediaWikiIntegrationTestCaseSchema1Test extends MediaWikiIntegrationTestCase {
/** @var bool */
public static $hasRun = false;
protected function setUp(): void {
parent::setUp();
// FIXME: fails under postgres - T198222
$this->markTestSkippedIfDbType( 'postgres' );
}
public function getSchemaOverrides( IMaintainableDatabase $db ) {
return [
'create' => [ 'MediaWikiIntegrationTestCaseTestTable', 'imagelinks' ],
'drop' => [ 'oldimage' ],
'alter' => [ 'pagelinks' ],
'scripts' => [ __DIR__ . '/MediaWikiIntegrationTestCaseSchemaTest.sql' ]
];
}
public function testMediaWikiIntegrationTestCaseSchemaTestOrder() {
// The test must be run before the second test
self::$hasRun = true;
$this->assertTrue( self::$hasRun );
}
public function testTableWasCreated() {
// Make sure MediaWikiIntegrationTestCaseTestTable was created.
$this->assertTrue( $this->db->tableExists( 'MediaWikiIntegrationTestCaseTestTable' ) );
}
public function testTableWasDropped() {
// Make sure oldimage was dropped
$this->assertFalse( $this->db->tableExists( 'oldimage' ) );
}
public function testTableWasOverriden() {
// Make sure imagelinks was overwritten
$this->assertTrue( $this->db->tableExists( 'imagelinks' ) );
$this->assertTrue( $this->db->fieldExists( 'imagelinks', 'il_frobnitz' ) );
}
public function testTableWasAltered() {
// The sql file does ALTER which doesn't exist in sqlite
$this->markTestSkippedIfDbType( 'sqlite' );
// Make sure pagelinks was altered
$this->assertTrue( $this->db->tableExists( 'pagelinks' ) );
$this->assertTrue( $this->db->fieldExists( 'pagelinks', 'pl_frobnitz' ) );
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Jul 3, 21:54 (16 h, 37 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ef/dd/6486dc80e2d7f8d8d3a1b8506492
Default Alt Text
MediaWikiIntegrationTestCaseSchema1Test.php (1 KB)

Event Timeline