PHP Класс lithium\console\command\Test

См. также: lithium\test
Наследование: extends lithium\console\Command
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$filters For example: sh lithium test lithium/tests/cases/core/ObjectTest.php --filters=Coverage lithium test lithium/tests/cases/core/ObjectTest.php --filters=Coverage,Profiler
$format Format to use for rendering results. Any other format than txt will cause the command to enter quiet mode, surpressing headers and any other decoration.
$plain boolean Good for command calls embedded into other scripts.
$verbose boolean Enable verbose output especially for the txt format.

Защищенные свойства (Protected)

Свойство Тип Описание
$_handlers array An array of closures, mapped by type, which are set up to handle different test output formats.

Открытые методы

Метод Описание
run ( string $path = null ) : integer | boolean Runs tests given a path to a directory or file containing tests. The path to the test(s) may be absolute or relative to the current working directory.

Защищенные методы

Метод Описание
_init ( ) : void Initializes the output handlers.
_library ( string $path ) : string Finds a library for given path.
_path ( string $path ) : string Validates and gets a fully-namespaced class path from an absolute or relative physical path to a directory or file. The final class path may be partial in that in doesn't contain the class name.

Описание методов

_init() защищенный Метод

Initializes the output handlers.
См. также: lithium\console\command\Test::$_handlers
protected _init ( ) : void
Результат void

_library() защищенный Метод

Finds a library for given path.
protected _library ( string $path ) : string
$path string Normalized (to slashes) absolute or relative path.
Результат string the name of the library

_path() защищенный Метод

This method can be thought of the reverse of Libraries::path(). lithium/tests/cases/core/ObjectTest.php -> lithium\tests\cases\core\ObjectTest lithium/tests/cases/core -> lithium\tests\cases\core lithium/core/Object.php -> lithium\core\Object lithium/core/ -> lithium\core lithium/core -> lithium\core
См. также: lithium\core\Libraries::path()
protected _path ( string $path ) : string
$path string The directory of or file path to one or more classes.
Результат string Returns a fully-namespaced class path, or `false`, if an error occurs.

run() публичный Метод

sh li3 test lithium/tests/cases/core/ObjectTest.php li3 test lithium/tests/cases/core If you are in the working directory of an application or plugin and wish to run all tests, simply execute the following: sh li3 test tests/cases If you are in the working directory of an application and wish to run a plugin, execute one of the following: sh li3 test libraries//tests/cases li3 test /tests/cases This will run /tests/cases//Test.php: sh li3 test //.php
public run ( string $path = null ) : integer | boolean
$path string Absolute or relative path to tests or a file which corresponding test should be run.
Результат integer | boolean Will (indirectly) exit with status `1` if one or more tests failed otherwise with `0`.

Описание свойств

$_handlers защищенное свойство

An array of closures, mapped by type, which are set up to handle different test output formats.
protected array $_handlers
Результат array

$filters публичное свойство

For example: sh lithium test lithium/tests/cases/core/ObjectTest.php --filters=Coverage lithium test lithium/tests/cases/core/ObjectTest.php --filters=Coverage,Profiler
public $filters

$format публичное свойство

Format to use for rendering results. Any other format than txt will cause the command to enter quiet mode, surpressing headers and any other decoration.
public $format

$plain публичное свойство

Good for command calls embedded into other scripts.
public bool $plain
Результат boolean

$verbose публичное свойство

Enable verbose output especially for the txt format.
public bool $verbose
Результат boolean