diff --git a/spec/PhpSpec/NyanFormattersExtension/ExtensionSpec.php b/spec/PhpSpec/NyanFormattersExtension/ExtensionSpec.php new file mode 100644 index 0000000..c41d92b --- /dev/null +++ b/spec/PhpSpec/NyanFormattersExtension/ExtensionSpec.php @@ -0,0 +1,26 @@ + + */ +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, []); + } +} diff --git a/spec/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatterSpec.php b/spec/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatterSpec.php new file mode 100644 index 0000000..076db91 --- /dev/null +++ b/spec/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatterSpec.php @@ -0,0 +1,33 @@ + + */ +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); + } + +} diff --git a/spec/PhpSpec/NyanFormattersExtension/Formatter/RatFormatterSpec.php b/spec/PhpSpec/NyanFormattersExtension/Formatter/RatFormatterSpec.php new file mode 100644 index 0000000..bf2e1ff --- /dev/null +++ b/spec/PhpSpec/NyanFormattersExtension/Formatter/RatFormatterSpec.php @@ -0,0 +1,33 @@ + + */ +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); + } + +} diff --git a/src/PhpSpec/NyanFormattersExtension/Extension.php b/src/PhpSpec/NyanFormattersExtension/Extension.php index 33aca42..3723ca8 100644 --- a/src/PhpSpec/NyanFormattersExtension/Extension.php +++ b/src/PhpSpec/NyanFormattersExtension/Extension.php @@ -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'); } /** diff --git a/src/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatter.php b/src/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatter.php new file mode 100644 index 0000000..57ea13c --- /dev/null +++ b/src/PhpSpec/NyanFormattersExtension/Formatter/DeadRatFormatter.php @@ -0,0 +1,41 @@ + + */ +class DeadRatFormatter extends NyanFormatter +{ + protected $states = + array( + array( + '~ ~ ~ ', + ' ~ ~ ', + ' _ ~ ~ ~ ~', + '/ \ M___M__ ', + '\__/_} _} >', + ' \____/ȣȣ ', + ), + array( + ' ~ ~ ', + ' ~ ~ ~ ~', + '~_ ~ ~ ', + '/ \ M___M__ ', + '\__/_} _} >', + ' \____/ȣȣ ', + ), + array( + ' ~ ~ ~ ~', + '~ ~ ~ ', + ' _ ~ ', + '/ \ M___M__ ', + '\__/_} _} >', + ' \____/ȣȣ ', + ) + ); +} diff --git a/src/PhpSpec/NyanFormattersExtension/Formatter/RatFormatter.php b/src/PhpSpec/NyanFormattersExtension/Formatter/RatFormatter.php new file mode 100644 index 0000000..d9bbef4 --- /dev/null +++ b/src/PhpSpec/NyanFormattersExtension/Formatter/RatFormatter.php @@ -0,0 +1,41 @@ + + */ +class RatFormatter extends NyanFormatter +{ + protected $states = + array( + array( + ' ~ ~ ', + ' ~ ', + ' ~ ___ ~ ~', + ' __/_ \☊☊_ ', + '/ \_}__}__>', + '\__ W W ' + ), + array( + ' ~ ', + ' ~ ~ ~', + '~ ~ ___ ~ ', + ' __/_ \☊☊_ ', + '/ \_}__}__>', + '\_/ M M ' + ), + array( + ' ~ ~ ~', + '~ ~ ~ ~ ', + ' ___ ~', + ' __/_ \☊☊_ ', + '/ \_}__}__>', + '\__ W W ' + ) + ); +}