PHP Class lithium\tests\cases\console\command\RouteTest

Inheritance: extends lithium\test\Unit
Afficher le fichier Open project: unionofrad/lithium

Protected Properties

Свойство Type Description
$_config array Holds config params.
$_testPath string Holds the temporary test path.

Méthodes publiques

Méthode Description
setUp ( ) Create a temporary routes.php file for testing and reset the router.
skip ( ) Set the testPath and check if it is writable (skip if not).
tearDown ( ) Delete the temporary routes.php file.
testAllWithEnvironment ( ) Tests the "all" command with an env (production) param.
testAllWithoutEnvironment ( ) Tests the "all" command without an env param.
testEnvironment ( ) Tests if the default environment is loaded correctly and if overriding works as expected.
testRouteLoading ( ) Test if the routes.php file is loaded correctly and the routes are connected to the router.
testRun ( ) Test the alias method for "all".
testShowWithEnvironment ( ) Test the show command with a env param.
testShowWithHttpMethod ( ) Test the show command with http method.
testShowWithInvalidRoute ( ) Test the show command with an invalid route.
testShowWithNoRoute ( ) Test the show command with no route.
testShowWithValidRoute ( ) Test the show command with a valid route.

Méthodes protégées

Méthode Description
_strip ( string $str ) : string Remove formatting whitespace, tabs and newlines for better sourcecode readability.

Method Details

_strip() protected méthode

Remove formatting whitespace, tabs and newlines for better sourcecode readability.
protected _strip ( string $str ) : string
$str string A string from which to strip spaces
Résultat string Returns the value of `$str` with all whitespace removed.

setUp() public méthode

Create a temporary routes.php file for testing and reset the router.
public setUp ( )

skip() public méthode

Set the testPath and check if it is writable (skip if not).
public skip ( )

tearDown() public méthode

Delete the temporary routes.php file.
public tearDown ( )

testAllWithEnvironment() public méthode

Don't be confused if the expected output doesn't make sense here. We are stripping the whitespace away so that this source code is easier to read. Built-In methods are used for output formatting and are tested elsewhere.

testAllWithoutEnvironment() public méthode

Don't be confused if the expected output doesn't make sense here. We are stripping the whitespace away so that this source code is easier to read. Built-In methods are used for output formatting and are tested elsewhere.

testEnvironment() public méthode

Tests if the default environment is loaded correctly and if overriding works as expected.
public testEnvironment ( )

testRouteLoading() public méthode

Test if the routes.php file is loaded correctly and the routes are connected to the router.
public testRouteLoading ( )

testRun() public méthode

Test the alias method for "all".
public testRun ( )

testShowWithEnvironment() public méthode

Test the show command with a env param.

testShowWithHttpMethod() public méthode

This tests a call similar to "li3 route GET /".

testShowWithInvalidRoute() public méthode

Test the show command with an invalid route.

testShowWithNoRoute() public méthode

Test the show command with no route.
public testShowWithNoRoute ( )

testShowWithValidRoute() public méthode

Test the show command with a valid route.

Property Details

$_config protected_oe property

Holds config params.
protected array $_config
Résultat array

$_testPath protected_oe property

Holds the temporary test path.
protected string $_testPath
Résultat string