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

List of all members.

Public Member Functions

 provideTitles ()
 If you want to run a the same test with a variety of data.
 setUp ()
 Anything that needs to happen before your tests should go here.
 tearDown ()
 Anything cleanup you need to do should go here.
 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 sentances when they run.

Detailed Description

Definition at line 3 of file SampleTest.php.


Member Function Documentation

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 44 of file SampleTest.php.

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

Reimplemented from MediaWikiLangTestCase.

Definition at line 8 of file SampleTest.php.

References $wgContLang, and Language\factory().

Here is the call graph for this function:

Anything cleanup you need to do should go here.

Reimplemented from MediaWikiLangTestCase.

Definition at line 19 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 85 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 58 of file SampleTest.php.

References $title, and Title\newFromText().

Here is the call graph for this function:

Definition at line 63 of file SampleTest.php.

References $title, and Title\newMainPage().

Here is the call graph for this function:

Name tests so that PHPUnit can turn them into sentances 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 30 of file SampleTest.php.

References $title, and Title\newFromText().

Here is the call graph for this function:


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