MediaWiki
REL1_23
|
Public Member Functions | |
provideTitles () | |
If you want to run a the same test with a variety of data, use a data provider. | |
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. | |
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. |
Definition at line 3 of file SampleTest.php.
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
Definition at line 49 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 91 of file SampleTest.php.
References $title.
TestSample::testCreateBasicListOfTitles | ( | $ | titleName, |
$ | ns, | ||
$ | text | ||
) |
provideTitles See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider
Definition at line 63 of file SampleTest.php.
References $title, and Title\newFromText().
Definition at line 68 of file SampleTest.php.
References $title, and Title\newMainPage().
MWException object See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException
Definition at line 99 of file SampleTest.php.
References $title, and Title\newFromText().
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().