PHPackages                             ciarand/pho - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ciarand/pho

ActiveLibrary[Framework](/categories/framework)

ciarand/pho
===========

A fork of the BDD testing framework

1.0.0(12y ago)029MITPHPPHP &gt;=5.4.0

Since Nov 28Pushed 10y agoCompare

[ Source](https://github.com/ciarand/pho)[ Packagist](https://packagist.org/packages/ciarand/pho)[ Docs](https://github.com/danielstjules/pho)[ RSS](/packages/ciarand-pho/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (5)Used By (0)

This project is deprecated and unmaintained. Proceed with caution!

[![pho](https://camo.githubusercontent.com/bb15aee02a011933b7fe8649fde99f501670393b35498aea1b100a4f8a2540a8/687474703a2f2f64616e69656c73746a756c65732e636f6d2f70686f2f6c6f676f2e706e67)](https://camo.githubusercontent.com/bb15aee02a011933b7fe8649fde99f501670393b35498aea1b100a4f8a2540a8/687474703a2f2f64616e69656c73746a756c65732e636f6d2f70686f2f6c6f676f2e706e67)

BDD test framework for PHP, inspired by Jasmine and RSpec. Work in progress. Feature requests and pull requests welcome!

[![Build Status](https://camo.githubusercontent.com/af4615570158afe4a8717515ea595baaff3a0d3319a1bae78ff23122dab54b7e/68747470733a2f2f7472617669732d63692e6f72672f63696172616e642f70686f2e706e67)](https://travis-ci.org/ciarand/pho)

- [Installation](#installation)
- [Writing Specs](#writing-specs)
- [Running Specs](#running-specs)
- [Expectations/Matchers](#expectationsmatchers)
- [Reporters](#reporters)
- [Mocking](#mocking)
- [Namespace](#namespace)
- [Options](#options)

Installation
------------

[](#installation)

The following instructions outline installation using Composer. If you don't have Composer, you can download it from

- Run either of the following commands, depending on your environment:

```
$ composer global require danielstjules/pho:dev-master
$ php composer.phar global require danielstjules/pho:dev-master

```

- Edit your `~/.bash_profile` or `~/.profile` and add:

```
export PATH=$HOME/.composer/vendor/bin:$PATH

```

Writing Specs
-------------

[](#writing-specs)

Pho exposes 8 functions for organizing and writing your tests: `describe`, `context`, `it`, `before`, `after`, `beforeEach`, `afterEach` and `expect`.

To create a suite, `describe` and `context` can be used by passing them a string and function. Both are interchangeable, though context is more often nested in a describe to group some set of behaviour. `it` is then used to create a spec, or test.

A spec may contain multiple expectations or assertions, and will pass so long as all assertions pass and no exception is uncaught. For asserting values in pho, `expect` can be used. The function accepts the value to be tested, and may be chained with a handful of matchers.

```
