wiki.techinc.nl/tests/phpunit/includes/BlockTest.php

39 lines
822 B
PHP
Raw Normal View History

2010-12-28 19:12:27 +00:00
<?php
class BlockTest extends MediaWikiTestCase {
private $block;
function setUp() {
global $wgContLang;
$wgContLang = Language::factory( 'en' );
}
function tearDown() {
}
function addDBData() {
$user = User::newFromName( 'UTBlockee' );
$user->addToDatabase();
$user->setPassword( 'UTBlockeePassword' );
$user->saveSettings();
$this->block = new Block( 'UTBlockee', 1, 0,
'Parce que', wfTimestampNow()
);
$this->block->insert();
}
function testInitializerFunctionsReturnCorrectBlock() {
$this->assertTrue( $this->block->equals( Block::newFromDB('UTBlockee') ), "newFromDB() returns the same block as the one that was made");
$this->assertTrue( $this->block->equals( Block::newFromID( 1 ) ), "newFromID() returns the same block as the one that was made");
}
}