From d417de70fcf39e0a7a15ba780b597914d16ca0f7 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 12 Mar 2014 18:12:23 +0100 Subject: Update to MediaWiki 1.22.4 --- tests/phpunit/includes/SampleTest.php | 105 ---------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 tests/phpunit/includes/SampleTest.php (limited to 'tests/phpunit/includes/SampleTest.php') diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php deleted file mode 100644 index 8516a4ce..00000000 --- a/tests/phpunit/includes/SampleTest.php +++ /dev/null @@ -1,105 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'en' ), - 'wgLanguageCode' => 'en', - ) ); - } - - /** - * Anything cleanup you need to do should go here. - */ - protected function tearDown() { - parent::tearDown(); - } - - /** - * Name tests so that PHPUnit can turn them into sentences when - * they run. While MediaWiki isn't strictly an Agile Programming - * project, you are encouraged to use the naming described under - * "Agile Documentation" at - * http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html - */ - public function testTitleObjectStringConversion() { - $title = Title::newFromText( "text" ); - $this->assertInstanceOf( 'Title', $title, "Title creation" ); - $this->assertEquals( "Text", $title, "Automatic string conversion" ); - - $title = Title::newFromText( "text", NS_MEDIA ); - $this->assertEquals( "Media:Text", $title, "Title creation with namespace" ); - } - - /** - * If you want to run a the same test with a variety of data. use a data provider. - * see: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html - * - * Note: Data providers are always called statically and outside setUp/tearDown! - */ - public static function provideTitles() { - return array( - array( 'Text', NS_MEDIA, 'Media:Text' ), - array( 'Text', null, 'Text' ), - array( 'text', null, 'Text' ), - array( 'Text', NS_USER, 'User:Text' ), - array( 'Photo.jpg', NS_FILE, 'File:Photo.jpg' ) - ); - } - - /** - * @dataProvider provideTitles - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider - */ - public function testCreateBasicListOfTitles( $titleName, $ns, $text ) { - $title = Title::newFromText( $titleName, $ns ); - $this->assertEquals( $text, "$title", "see if '$titleName' matches '$text'" ); - } - - public function testSetUpMainPageTitleForNextTest() { - $title = Title::newMainPage(); - $this->assertEquals( "Main Page", "$title", "Test initial creation of a title" ); - - return $title; - } - - /** - * Instead of putting a bunch of tests in a single test method, - * you should put only one or two tests in each test method. This - * way, the test method names can remain descriptive. - * - * If you want to make tests depend on data created in another - * method, you can create dependencies feed whatever you return - * from the dependant method (e.g. testInitialCreation in this - * example) as arguments to the next method (e.g. $title in - * testTitleDepends is whatever testInitialCreatiion returned.) - */ - - /** - * @depends testSetUpMainPageTitleForNextTest - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends - */ - public function testCheckMainPageTitleIsConsideredLocal( $title ) { - $this->assertTrue( $title->isLocal() ); - } - - /** - * @expectedException MWException object - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException - */ - public function testTitleObjectFromObject() { - $title = Title::newFromText( Title::newFromText( "test" ) ); - $this->assertEquals( "Test", $title->isLocal() ); - } -} -- cgit v1.2.3-54-g00ecf