Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: phpspec/nyan-formatters
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.1
Choose a base ref
...
head repository: phpspec/nyan-formatters
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 12 commits
  • 8 files changed
  • 4 contributors

Commits on Aug 18, 2014

  1. Copy the full SHA
    4eb7b70 View commit details

Commits on Jan 20, 2015

  1. Copy the full SHA
    2f85ed4 View commit details
  2. Fix path

    jasonlfunk committed Jan 20, 2015
    Copy the full SHA
    1932ad5 View commit details
  3. Merge pull request #5 from jasonlfunk/master

    Change screenshots to animated GIFs
    whatthejeff committed Jan 20, 2015
    Copy the full SHA
    9a760a6 View commit details
  4. Fix screenshot paths.

    whatthejeff committed Jan 20, 2015
    Copy the full SHA
    dd784df View commit details

Commits on Jul 22, 2016

  1. Prepare for PhpSpec 3.0

    mdavis1982 committed Jul 22, 2016
    Copy the full SHA
    7204c8c View commit details

Commits on Aug 3, 2017

  1. support phpspec 4

    samsonasik authored Aug 3, 2017
    Copy the full SHA
    2b5188b View commit details

Commits on Aug 4, 2017

  1. Merge pull request #10 from samsonasik/patch-1

    Support phpspec 4
    mdavis1982 authored Aug 4, 2017
    Copy the full SHA
    fbdc637 View commit details

Commits on Jul 2, 2018

  1. support phpspec 5.0

    samsonasik authored Jul 2, 2018
    Copy the full SHA
    8e16a7e View commit details

Commits on Jul 3, 2018

  1. Merge pull request #12 from samsonasik/patch-1

    Add support for phpspec 5.0
    mdavis1982 authored Jul 3, 2018
    Copy the full SHA
    28f96f1 View commit details

Commits on Dec 11, 2019

  1. add phpspec 6 support

    samsonasik authored Dec 11, 2019
    Copy the full SHA
    58c44a9 View commit details

Commits on Jan 7, 2020

  1. Merge pull request #14 from samsonasik/patch-1

    Add phpspec 6 Support
    mdavis1982 authored Jan 7, 2020
    Copy the full SHA
    641fe7a View commit details
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# PHPSpec Nyan Formatters Extension
This PHPSpec extension provides more Nyan formatters for PHPSpec.
This PHPSpec extension provides Nyan formatters for PHPSpec.

## Requirements

This extension requires:

* PHP 5.3.3 or later.
* A terminal emulator with support for ANSI escape sequences, including color
and cursor control.

**NOTE:** By default, the Windows console does not support ANSI escape
sequences. If you'd like to use this extension on Windows, you may want
to try one of the following solutions:

* [ANSICON](https://github.com/adoxa/ansicon)
* [ConEmu](https://github.com/Maximus5/ConEmu)


## Installation
To install this, make sure you are using the latest release of PHPSpec, and then add the following to your
@@ -8,30 +24,30 @@ To install this, make sure you are using the latest release of PHPSpec, and then
```json
"require-dev": {
...,
"phpspec/nyan-formatters": "1.*"
"phpspec/nyan-formatters": "2.*"
}
```

Install or update your dependencies, and then in a `phpspec.yml` file in the root of your project, add the following:

```yaml
extensions:
- PhpSpec\NyanFormattersExtension\Extension
PhpSpec\NyanFormattersExtension\Extension: ~
```
Then, you can add a `--format` switch to your `phpspec` command with one of the following values:

- `nyan.cat` - Gives the standard Nyan Cat formatter

![nyan cat formatter preview](https://raw.github.com/phpspec/nyan-formatters/screenshots/formatters/cat.png)
![nyan cat formatter preview](screenshots/formatters/cat.gif)

- `nyan.dino` - Gives a dinosaur formatter - Rawwr!

![nyan dino formatter preview](https://raw.github.com/phpspec/nyan-formatters/screenshots/formatters/dino.png)
![nyan dino formatter preview](screenshots/formatters/dino.gif)

- `nyan.crab` - Gives a crab formatter

![nyan crab formatter preview](https://raw.github.com/phpspec/nyan-formatters/screenshots/formatters/crab.png)
![nyan crab formatter preview](screenshots/formatters/crab.gif)

If you want to use one of the formatters all the time, you can enforce a default by adding a `formatter.name` option in
the `phpspec.yml` file as follows:
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"license": "MIT",
"require": {
"php": ">=5.3.3",
"phpspec/phpspec": "~2.0",
"phpspec/phpspec": "~3.0|~4.0|~5.0|~6.0",
"whatthejeff/nyancat-scoreboard": "~1.1"
},
"autoload": {
2 changes: 1 addition & 1 deletion phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
extensions:
- PhpSpec\NyanFormattersExtension\Extension
PhpSpec\NyanFormattersExtension\Extension: ~
Binary file added screenshots/formatters/cat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/formatters/crab.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/formatters/dino.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/PhpSpec/NyanFormattersExtension/Extension.php
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

namespace PhpSpec\NyanFormattersExtension;

use PhpSpec\Extension\ExtensionInterface;
use PhpSpec\Extension as PhpSpecExtension;
use PhpSpec\ServiceContainer;

/**
@@ -12,12 +12,12 @@
*
* @author Matthew Davis <matt@mattdavis.co.uk>
*/
class Extension implements ExtensionInterface
class Extension implements PhpSpecExtension
{
/**
* {@inheritdoc}
*/
public function load(ServiceContainer $container)
public function load(ServiceContainer $container, array $params)
{
$this->addFormatter($container, 'cat', 'PhpSpec\NyanFormattersExtension\Formatter\NyanFormatter');
$this->addFormatter($container, 'dino', 'PhpSpec\NyanFormattersExtension\Formatter\DinoFormatter');
@@ -33,7 +33,7 @@ public function load(ServiceContainer $container)
*/
protected function addFormatter(ServiceContainer $container, $name, $class)
{
$container->set('formatter.formatters.nyan.' . $name, function ($c) use ($class) {
$container->define('formatter.formatters.nyan.' . $name, function ($c) use ($class) {
/** @var ServiceContainer $c */
return new $class(
$c->get('formatter.presenter'),
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

use PhpSpec\Event\SuiteEvent;
use PhpSpec\Event\ExampleEvent;
use PhpSpec\Formatter\DotFormatter;
use PhpSpec\Formatter\ConsoleFormatter;

use NyanCat\Cat;
use NyanCat\Rainbow;
@@ -21,7 +21,7 @@
* @author Jeff Welch <whatthejeff@gmail.com>
* @author Matthew Davis <matt@mattdavis.co.uk>
*/
class NyanFormatter extends DotFormatter
class NyanFormatter extends ConsoleFormatter
{
/**
* The number of examples