MediaWiki REL1_31
CommandTest Class Reference

\MediaWiki\Shell\Command Shell More...

Inheritance diagram for CommandTest:
Collaboration diagram for CommandTest:

Public Member Functions

 provideExecute ()
 
 testDisablingRestrictions ()
 Ensure that it's possible to disable the default shell restrictions.
 
 testEnvironment ()
 
 testExecute ( $command, $args, $expectedExitCode, $expectedOutput)
 provideExecute
 
 testInput ()
 
 testLogStderr ()
 
 testNullsAreSkipped ()
 Test that null values are skipped by params() and unsafeParams()
 
 testOutput ()
 
 testStdout ()
 
 testStdoutRedirection ()
 
 testT69870 ()
 

Private Member Functions

 getPhpCommand ( $fileName, array $args=[])
 Creates a command that will execute one of the PHP test scripts by its file name, using the current PHP_BIN binary.
 
 requirePosix ()
 

Detailed Description

\MediaWiki\Shell\Command Shell

Definition at line 11 of file CommandTest.php.

Member Function Documentation

◆ getPhpCommand()

CommandTest::getPhpCommand (   $fileName,
array  $args = [] 
)
private

Creates a command that will execute one of the PHP test scripts by its file name, using the current PHP_BIN binary.

NOTE: the PHP test scripts are located in the sub directory "bin".

Parameters
string$fileNamea file name in the "bin" sub-directory
array$argsan array of arguments to pass to the PHP script
Returns
Command a command instance pointing to the right script

Definition at line 205 of file CommandTest.php.

References $args, $command, and $params.

Referenced by testEnvironment(), testExecute(), testInput(), testLogStderr(), testOutput(), testStdout(), and testT69870().

◆ provideExecute()

CommandTest::provideExecute ( )

Definition at line 34 of file CommandTest.php.

◆ requirePosix()

CommandTest::requirePosix ( )
private

Definition at line 15 of file CommandTest.php.

References wfIsWindows().

Referenced by testInput(), testStdoutRedirection(), and testT69870().

◆ testDisablingRestrictions()

CommandTest::testDisablingRestrictions ( )

Ensure that it's possible to disable the default shell restrictions.

See also
T257278

Definition at line 184 of file CommandTest.php.

References $command.

◆ testEnvironment()

CommandTest::testEnvironment ( )

Definition at line 42 of file CommandTest.php.

References $command, and getPhpCommand().

◆ testExecute()

CommandTest::testExecute (   $command,
  $args,
  $expectedExitCode,
  $expectedOutput 
)

provideExecute

Definition at line 24 of file CommandTest.php.

References $args, $command, and getPhpCommand().

◆ testInput()

CommandTest::testInput ( )

Definition at line 158 of file CommandTest.php.

References $command, getPhpCommand(), and requirePosix().

◆ testLogStderr()

CommandTest::testLogStderr ( )

Definition at line 139 of file CommandTest.php.

References $command, $context, getPhpCommand(), and true.

◆ testNullsAreSkipped()

CommandTest::testNullsAreSkipped ( )

Test that null values are skipped by params() and unsafeParams()

Definition at line 110 of file CommandTest.php.

References $command, and wfIsWindows().

◆ testOutput()

CommandTest::testOutput ( )

Definition at line 77 of file CommandTest.php.

References $command, and getPhpCommand().

◆ testStdout()

CommandTest::testStdout ( )

Definition at line 51 of file CommandTest.php.

References $command, and getPhpCommand().

◆ testStdoutRedirection()

CommandTest::testStdoutRedirection ( )

Definition at line 62 of file CommandTest.php.

References $command, and requirePosix().

◆ testT69870()

CommandTest::testT69870 ( )

Definition at line 122 of file CommandTest.php.

References $command, $output, getPhpCommand(), and requirePosix().


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