905ff796ac80f97b903097147ec666c8000f2729
[lhc/web/wiklou.git] / maintenance / tests / phpunit / includes / SampleTest.php
1 <?php
2
3 class TestSample extends PHPUnit_Framework_TestCase {
4
5 function setUp() {
6 }
7
8 function testEqual() {
9 $title = Title::newFromText("text");
10 $this->assertEquals("Text", $title->__toString(), "Title creation");
11 $this->assertEquals("Text", "Text", "Automatic string conversion");
12
13 $title = Title::newFromText("text", NS_MEDIA);
14 $this->assertEquals("Media:Text", $title->__toString(), "Title creation with namespace");
15
16 }
17
18 /**
19 * @expectedException MWException object
20 *
21 * Above comment tells PHPUnit to expect an exception of the
22 * MWException class containing the string "object" in the
23 * message.
24 */
25 function testException() {
26 $title = Title::newFromText(new Title("test"));
27 }
28 }