<?php
-class TestSample extends PHPUnit_Framework_TestCase {
+class TestSample extends MediaWikiLangTestCase {
/**
* Anything that needs to happen before your tests should go here.
*/
function setUp() {
global $wgContLang;
+ parent::setUp();
+
/* For example, we need to set $wgContLang for creating a new Title */
$wgContLang = Language::factory( 'en' );
}
* Anything cleanup you need to do should go here.
*/
function tearDown() {
+ parent::tearDown();
}
/**
array( 'Text', null, 'Text' ),
array( 'text', null, 'Text' ),
array( 'Text', NS_USER, 'User:Text' ),
- array( 'Photo.jpg', NS_IMAGE, 'File:Photo.jpg' )
+ array( 'Photo.jpg', NS_FILE, 'File:Photo.jpg' )
);
}
* See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException
*/
function testTitleObjectFromObject() {
- $title = Title::newFromText( new Title( "test" ) );
+ $title = Title::newFromText( Title::newFromText( "test" ) );
$this->assertEquals( "Test", $title->isLocal() );
}
}