Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rat and deadRat formatters #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions spec/PhpSpec/NyanFormattersExtension/ExtensionSpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace spec\PhpSpec\NyanFormattersExtension;

use PhpSpec\NyanFormattersExtension\Extension;
use PhpSpec\Extension as PhpSpecExtension;
use PhpSpec\ObjectBehavior;
use PhpSpec\ServiceContainer;

/**
* @author Piotr Walków <[email protected]>
*/
class ExtensionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(Extension::class);
$this->shouldImplement(PhpSpecExtension::class);
}

function it_loads_formatters(
ServiceContainer $container
) {
$this->load($container, []);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace spec\PhpSpec\NyanFormattersExtension\Formatter;

use PhpSpec\Console\ConsoleIO;
use PhpSpec\Formatter\Presenter\Presenter;
use PhpSpec\Listener\StatisticsCollector;
use PhpSpec\NyanFormattersExtension\Formatter\DeadRatFormatter;
use PhpSpec\ObjectBehavior;

/**
* DeadRatFormatterSpec
*
* @package spec\PhpSpec\NyanFormattersExtension\Formatter
*
* @author Piotr Walków <[email protected]>
*/
class DeadRatFormatterSpec extends ObjectBehavior
{
function let(
Presenter $presenter,
ConsoleIO $io,
StatisticsCollector $stats
) {
$this->beConstructedWith($presenter, $io, $stats);
}

function it_is_initializable()
{
$this->shouldHaveType(DeadRatFormatter::class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace spec\PhpSpec\NyanFormattersExtension\Formatter;

use PhpSpec\Console\ConsoleIO;
use PhpSpec\Formatter\Presenter\Presenter;
use PhpSpec\Listener\StatisticsCollector;
use PhpSpec\NyanFormattersExtension\Formatter\RatFormatter;
use PhpSpec\ObjectBehavior;

/**
* RatFormatterSpec
*
* @package spec\PhpSpec\NyanFormattersExtension\Formatter
*
* @author Piotr Walków <[email protected]>
*/
class RatFormatterSpec extends ObjectBehavior
{
function let(
Presenter $presenter,
ConsoleIO $io,
StatisticsCollector $stats
) {
$this->beConstructedWith($presenter, $io, $stats);
}

function it_is_initializable()
{
$this->shouldHaveType(RatFormatter::class);
}

}
2 changes: 2 additions & 0 deletions src/PhpSpec/NyanFormattersExtension/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function load(ServiceContainer $container, array $params)
$this->addFormatter($container, 'cat', 'PhpSpec\NyanFormattersExtension\Formatter\NyanFormatter');
$this->addFormatter($container, 'dino', 'PhpSpec\NyanFormattersExtension\Formatter\DinoFormatter');
$this->addFormatter($container, 'crab', 'PhpSpec\NyanFormattersExtension\Formatter\CrabFormatter');
$this->addFormatter($container, 'rat', 'PhpSpec\NyanFormattersExtension\Formatter\RatFormatter');
$this->addFormatter($container, 'deadRat', 'PhpSpec\NyanFormattersExtension\Formatter\DeadRatFormatter');
}

/**
Expand Down
41 changes: 41 additions & 0 deletions src/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace PhpSpec\NyanFormattersExtension\Formatter;

/**
* DeadRatFormatter
*
* @package NyanFormattersExtension
*
* @author Piotr Walków <[email protected]>
*/
class DeadRatFormatter extends NyanFormatter
{
protected $states =
array(
array(
'~ ~ ~ ',
' ~ ~ ',
' _ ~ ~ ~ ~',
'/ \ M___M__ ',
'\__/_} _} >',
' \____/ȣȣ ',
),
array(
' ~ ~ ',
' ~ ~ ~ ~',
'~_ ~ ~ ',
'/ \ M___M__ ',
'\__/_} _} >',
' \____/ȣȣ ',
),
array(
' ~ ~ ~ ~',
'~ ~ ~ ',
' _ ~ ',
'/ \ M___M__ ',
'\__/_} _} >',
' \____/ȣȣ ',
)
);
}
41 changes: 41 additions & 0 deletions src/PhpSpec/NyanFormattersExtension/Formatter/RatFormatter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace PhpSpec\NyanFormattersExtension\Formatter;

/**
* RatFormatter
*
* @package NyanFormattersExtension
*
* @author Piotr Walków <[email protected]>
*/
class RatFormatter extends NyanFormatter
{
protected $states =
array(
array(
' ~ ~ ',
' ~ ',
' ~ ___ ~ ~',
' __/_ \☊☊_ ',
'/ \_}__}__>',
'\__ W W '
),
array(
' ~ ',
' ~ ~ ~',
'~ ~ ___ ~ ',
' __/_ \☊☊_ ',
'/ \_}__}__>',
'\_/ M M '
),
array(
' ~ ~ ~',
'~ ~ ~ ~ ',
' ___ ~',
' __/_ \☊☊_ ',
'/ \_}__}__>',
'\__ W W '
)
);
}