Skip to content

Commit

Permalink
Update options and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstjules committed Dec 28, 2014
1 parent 9aee15b commit 8056ada
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
![pho](http://danielstjules.com/github/pho-logo.png)

BDD test framework for PHP, inspired by Jasmine and RSpec. Work in progress.

Note: While the public API is stable, the internals are currently being rewritten.
I intend to make that dev branch public soon. Once available, I'd be happy to
once again accept PRs, but specifically on that development branch. Thanks!
BDD test framework for PHP, inspired by Jasmine and RSpec. Features a familiar
syntax, and a watch command to automatically re-run specs during development.
It can also be extended with custom matchers and reporters.

[![Build Status](https://travis-ci.org/danielstjules/pho.svg?branch=master)](https://travis-ci.org/danielstjules/pho)

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

## Installation

Expand All @@ -36,6 +34,25 @@ $ php composer.phar global require danielstjules/pho:dev-master
export PATH=$HOME/.composer/vendor/bin:$PATH
```

## Usage

``` bash
Usage: pho [options] [files]

Options

-a --ascii Show ASCII art on completion
-b --bootstrap <bootstrap> Bootstrap file to load
-f --filter <pattern> Run specs containing a pattern
-h --help Output usage information
-n --namespace Only use namespaced functions
-r --reporter <name> Specify the reporter to use
-s --stop Stop on failure
-v --version Display version number
-w --watch Watch files for changes and rerun specs
-C --no-color Disable terminal colors
```

## Writing Specs

Pho exposes 8 functions for organizing and writing your tests: `describe`,
Expand Down Expand Up @@ -449,21 +466,3 @@ pho\describe('A suite', function() {
});
});
```

## Options

```
$ bin/pho --help
Usage: pho [options] [files]
Options
-a --ascii Show ASCII art on completion
-h --help Output usage information
-f --filter <pattern> Run specs containing a pattern
-r --reporter <name> Specify the reporter to use
-s --stop Stop on failure
-v --version Display version number
-w --watch Watch files for changes and rerun specs
-n --namespace Only use namespaced functions
```
4 changes: 2 additions & 2 deletions spec/Console/ConsoleSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

expect($console->options)->toEqual([
'ascii' => false,
'help' => false,
'bootstrap' => false,
'filter' => false,
'help' => false,
'namespace' => false,
'reporter' => 'dot',
'stop' => true,
'version' => false,
'watch' => false,
'namespace' => false,
'no-color' => false
]);
});
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class Console

private $availableOptions = [
'ascii' => ['--ascii', '-a', 'Show ASCII art on completion'],
'help' => ['--help', '-h', 'Output usage information'],
'bootstrap' => ['--bootstrap', '-b', 'Bootstrap file to load', 'bootstrap'],
'filter' => ['--filter', '-f', 'Run specs containing a pattern', 'pattern'],
'help' => ['--help', '-h', 'Output usage information'],
'namespace' => ['--namespace', '-n', 'Only use namespaced functions'],
'reporter' => ['--reporter', '-r', 'Specify the reporter to use', 'name'],
'stop' => ['--stop', '-s', 'Stop on failure'],
'version' => ['--version', '-v', 'Display version number'],
'watch' => ['--watch', '-w', 'Watch files for changes and rerun specs'],
'namespace' => ['--namespace', '-n', 'Only use namespaced functions'],
'no-color' => ['--no-color', '-C', 'Disable terminal colors'],

// TODO: Implement options below
Expand Down

0 comments on commit 8056ada

Please sign in to comment.