From: X! Date: Tue, 28 Dec 2010 19:12:27 +0000 (+0000) Subject: Add BlockTest unit test X-Git-Tag: 1.31.0-rc.0~33023 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=a9ff87335fd15be4a7a637dda1f10efc8fc2e754;p=lhc%2Fweb%2Fwiklou.git Add BlockTest unit test --- diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php new file mode 100644 index 0000000000..a4ae047f3b --- /dev/null +++ b/tests/phpunit/includes/BlockTest.php @@ -0,0 +1,38 @@ +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"); + + } + +} +