MediaWiki  REL1_22
SemiMockedFetchText Class Reference

Mock for the input/output of FetchText. More...

Inheritance diagram for SemiMockedFetchText:
Collaboration diagram for SemiMockedFetchText:

List of all members.

Public Member Functions

 getStdin ($len=null)
 Return input from stdin.
 mockGetInvocations ()
 Gets invocation counters for mocked methods.
 mockStdin ($stdin)
 Data for the fake stdin.

Private Attributes

Array $mockInvocations = array( 'getStdin' => 0 )
 Invocation counters for the mocked aspects.
bool $mockSetUp = false
 Whether or not a text for stdin has been provided.
String null $mockStdinText = null
 Text to pass as stdin.

Detailed Description

Mock for the input/output of FetchText.

FetchText internally tries to access stdin and stdout. We mock those aspects for testing.

Definition at line 11 of file fetchTextTest.php.


Member Function Documentation

SemiMockedFetchText::getStdin ( len = null)

Return input from stdin.

Parameters:
$lenInteger: the number of bytes to read. If null, just return the handle. Maintenance::STDIN_ALL returns the full length
Returns:
Mixed

Reimplemented from Maintenance.

Definition at line 49 of file fetchTextTest.php.

Gets invocation counters for mocked methods.

Returns:
Array An array, whose keys are function names. The corresponding values denote the number of times the function has been invoked.

Definition at line 42 of file fetchTextTest.php.

Data for the fake stdin.

Parameters:
$stdinString The string to be used instead of stdin

Definition at line 31 of file fetchTextTest.php.


Member Data Documentation

Array SemiMockedFetchText::$mockInvocations = array( 'getStdin' => 0 ) [private]

Invocation counters for the mocked aspects.

Definition at line 23 of file fetchTextTest.php.

bool SemiMockedFetchText::$mockSetUp = false [private]

Whether or not a text for stdin has been provided.

Definition at line 19 of file fetchTextTest.php.

String null SemiMockedFetchText::$mockStdinText = null [private]

Text to pass as stdin.

Definition at line 15 of file fetchTextTest.php.


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