Forrest logo
tool overview
On this page you find all important commands for the CLI tool phpspec. If the command you are looking for is missing please ask our AI.

phpspec

phpspec is a tool which can help you write clean and working PHP code using behaviour driven development or BDD. BDD is a technique derived from test-first development.

BDD is a technique used at story level and spec level. phpspec is a tool for use at the spec level or SpecBDD. The technique is to first use a tool like phpspec to describe the behaviour of an object you are about to write. Next you write just enough code to meet that specification and finally you refactor this code.

List of commands for phpspec:

  • phpspec:tldr:0a7fa phpspec: Enable fake return values.
    $ phpspec run --fake
    try on your machine
    explain this command
  • phpspec:tldr:0c256 phpspec: Disable code generation prompts.
    $ phpspec run --no-code-generation
    try on your machine
    explain this command
  • phpspec:tldr:12c08 phpspec: Create a specification for a class.
    $ phpspec describe ${class_name}
    try on your machine
    explain this command
  • phpspec:tldr:22c9a phpspec: Run specifications using a specific configuration file.
    $ phpspec run -c ${path-to-configuration_file}
    try on your machine
    explain this command
  • phpspec:tldr:48af6 phpspec: Run specifications using a specific bootstrap file.
    $ phpspec run -b ${path-to-bootstrap_file}
    try on your machine
    explain this command
  • phpspec:tldr:53d57 phpspec: Run all specifications in the "spec" directory.
    $ phpspec run
    try on your machine
    explain this command
  • phpspec:tldr:8e160 phpspec: Run a single specification.
    $ phpspec run ${path-to-class_specification_file}
    try on your machine
    explain this command
tool overview