r75245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75244‎ | r75245 | r75246 >
Date:15:06, 23 October 2010
Author:mah
Status:resolved
Tags:
Comment:
Initial checkin from !mwhack of a sample PHPUnit check.
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/SampleTest.php (added) (history)

Diff [purge]

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
130 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r75419Follow up r75245....platonides13:54, 26 October 2010

Status & tagging log