MediaWiki  REL1_22
TestSample Class Reference
Inheritance diagram for TestSample:
Collaboration diagram for TestSample:

List of all members.

Public Member Functions

 testCheckMainPageTitleIsConsideredLocal ($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.
 testCreateBasicListOfTitles ($titleName, $ns, $text)
 provideTitles See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider
 testSetUpMainPageTitleForNextTest ()
 testTitleObjectFromObject ()
 MWException object See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException
 testTitleObjectStringConversion ()
 Name tests so that PHPUnit can turn them into sentences when they run.

Static Public Member Functions

static provideTitles ()
 If you want to run a the same test with a variety of data.

Protected Member Functions

 setUp ()
 Anything that needs to happen before your tests should go here.
 tearDown ()
 Anything cleanup you need to do should go here.

Detailed Description

Definition at line 3 of file SampleTest.php.


Member Function Documentation

static TestSample::provideTitles ( ) [static]

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!

Definition at line 51 of file SampleTest.php.

References array().

TestSample::setUp ( ) [protected]

Anything that needs to happen before your tests should go here.

Reimplemented from MediaWikiLangTestCase.

Definition at line 8 of file SampleTest.php.

References array(), Language\factory(), and MediaWikiTestCase\setMwGlobals().

TestSample::tearDown ( ) [protected]

Anything cleanup you need to do should go here.

Reimplemented from MediaWikiTestCase.

Definition at line 25 of file SampleTest.php.

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.) testSetUpMainPageTitleForNextTest See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends

Definition at line 93 of file SampleTest.php.

References $title.

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

Definition at line 36 of file SampleTest.php.

References $title, and Title\newFromText().


The documentation for this class was generated from the following file: