3 class TestSample
extends PHPUnit_Framework_TestCase
{
9 $title = Title
::newFromText("text");
10 $this->assertEquals("Text", $title->__toString(), "Title creation");
11 $this->assertEquals("Text", "Text", "Automatic string conversion");
13 $title = Title
::newFromText("text", NS_MEDIA
);
14 $this->assertEquals("Media:Text", $title->__toString(), "Title creation with namespace");
19 * @expectedException MWException object
21 * Above comment tells PHPUnit to expect an exception of the
22 * MWException class containing the string "object" in the
25 function testException() {
26 $title = Title
::newFromText(new Title("test"));