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

Inheritance: extends lithium\test\Unit
Datei anzeigen Open project: unionofrad/lithium

Protected Properties

Property Type Description
$_config array Holds config params.
$_testPath string Holds the temporary test path.

Public Methods

Method 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.

Protected Methods

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

Method Details

_strip() protected method

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

setUp() public method

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

skip() public method

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

tearDown() public method

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

testAllWithEnvironment() public method

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 method

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 method

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

testRouteLoading() public method

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

testRun() public method

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

testShowWithEnvironment() public method

Test the show command with a env param.

testShowWithHttpMethod() public method

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

testShowWithInvalidRoute() public method

Test the show command with an invalid route.

testShowWithNoRoute() public method

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

testShowWithValidRoute() public method

Test the show command with a valid route.

Property Details

$_config protected_oe property

Holds config params.
protected array $_config
return array

$_testPath protected_oe property

Holds the temporary test path.
protected string $_testPath
return string