Index: trunk/phase3/maintenance/tests/phpunit/includes/SampleTest.php |
— | — | @@ -0,0 +1,28 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class TestSample extends PHPUnit_Framework_TestCase { |
| 5 | + |
| 6 | + function setUp() { |
| 7 | + } |
| 8 | + |
| 9 | + function testEqual() { |
| 10 | + $title = Title::newFromText("text"); |
| 11 | + $this->assertEquals("Text", $title->__toString(), "Title creation"); |
| 12 | + $this->assertEquals("Text", "Text", "Automatic string conversion"); |
| 13 | + |
| 14 | + $title = Title::newFromText("text", NS_MEDIA); |
| 15 | + $this->assertEquals("Media:Text", $title->__toString(), "Title creation with namespace"); |
| 16 | + |
| 17 | + } |
| 18 | + |
| 19 | + /** |
| 20 | + * @expectedException MWException object |
| 21 | + * |
| 22 | + * Above comment tells PHPUnit to expect an exception of the |
| 23 | + * MWException class containing the string "object" in the |
| 24 | + * message. |
| 25 | + */ |
| 26 | + function testException() { |
| 27 | + $title = Title::newFromText(new Title("test")); |
| 28 | + } |
| 29 | +} |
Property changes on: trunk/phase3/maintenance/tests/phpunit/includes/SampleTest.php |
___________________________________________________________________ |
Added: svn:eol-syle |
1 | 30 | + native |