Download the PHP package devel0pmenthero/crash without Composer
On this page you can find all versions of the php package devel0pmenthero/crash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devel0pmenthero/crash
More information about devel0pmenthero/crash
Files in devel0pmenthero/crash
Package crash
Short Description A small library for unit- and pentesting code.
License MIT
Informations about the package crash
Crash
A small unit- and pentest library for PHP.
Installation
composer require devel0pmenthero/crash
Usage
Note: Any parameters can be specified with a leading capital letter.
Generating tests
Single classes
Directories
Inherited methods can be included via passing an optional "inherit"-parameter.
Existing test classes can be overwritten by passing an optional "overwrite"-parameter.
Running tests
Omitting the path will default to the path stored in the public Crash::Tests
constant.
Attributes
Crash allows the user to control the execution of specific tests via defining custom attributes. While generating Crash\Tests from existing source, the library will copy over any existing (Crash-)Attributes to the final test classes.
Repeat
#[Repeat(Amount: int, Interval: int)]
The "Repeat"-Attribute allows to execute a test case multiple times in an optional specified interval of microseconds.
Crash
#[Crash(Amount: int, Interval: int)]
The "Crash"-Attribute acts like the former one but passes a random amount of random values to the desired test case instead.
Values
#[Values(Random: int, Interval: int, ...$Values)]
The "Values"-Attribute allows specifying custom values being passed as parameters to the desired test case. Alternatively, the Attribute can generate a specified random amount of values.
Skip
#[Skip]
The "Skip"-Attribute simply instructs the library to skip the test- or case.
Writing Tests
Test are simple php classes and must be located in the "Crash\Tests"-namespace to be recognized as a test.