wiki.techinc.nl/tests/phpunit/includes/NewDBTest.php
Platonides 84709ae3b3 Follow up r79109.
Don't setup/destroy for databaseless tests.
Make needsDB() return based on the DocComment.
Delayed db init until the test is run, so that it isn't set for excluded tests (the exclusion is done after all the classes are instantiated).
2010-12-29 15:01:47 +00:00

38 lines
729 B
PHP

<?php
/**
* @group Database
*/
class NewDBTest extends MediaWikiTestCase {
function setUp() {
}
function tearDown() {
}
function addDBData() {
//Make a page
$article = new Article( Title::newFromText( 'Foobar' ) );
$article->doEdit( 'FoobarContent',
'',
EDIT_NEW,
false,
User::newFromName( 'UTSysop' ) );
}
function testBootstrapCreation() {
$article = new Article( Title::newFromText("UTPage") );
$this->assertEquals("UTContent", $article->fetchContent(), "Automatic main page creation");
$article = new Article( Title::newFromText("Foobar") );
$this->assertEquals("FoobarContent", $article->fetchContent(), "addDBData() adds to the database");
}
}