From 72b15f9dd962a3d1f768384a4ecb78bf37d2c288 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Sat, 23 Oct 2010 15:06:06 +0000 Subject: [PATCH] Initial checkin from !mwhack of a sample PHPUnit check. --- .../tests/phpunit/includes/SampleTest.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 maintenance/tests/phpunit/includes/SampleTest.php diff --git a/maintenance/tests/phpunit/includes/SampleTest.php b/maintenance/tests/phpunit/includes/SampleTest.php new file mode 100644 index 0000000000..905ff796ac --- /dev/null +++ b/maintenance/tests/phpunit/includes/SampleTest.php @@ -0,0 +1,28 @@ +assertEquals("Text", $title->__toString(), "Title creation"); + $this->assertEquals("Text", "Text", "Automatic string conversion"); + + $title = Title::newFromText("text", NS_MEDIA); + $this->assertEquals("Media:Text", $title->__toString(), "Title creation with namespace"); + + } + + /** + * @expectedException MWException object + * + * Above comment tells PHPUnit to expect an exception of the + * MWException class containing the string "object" in the + * message. + */ + function testException() { + $title = Title::newFromText(new Title("test")); + } +} -- 2.20.1