2017 © Pedro Peláez
 

library symfony-behat-debug-bundle

image

filipgolonka/symfony-behat-debug-bundle

  • Tuesday, November 28, 2017
  • by filipgolonka
  • Repository
  • 1 Watchers
  • 1 Stars
  • 502 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Symfony Behat Debug Bundle

Bridge between Symfony and PhpSpec which adds PhpSpec formatters to Symfony DI Container., (*1)

Usage

  • Add package to your application dependencies
composer require --dev filipgolonka/symfony-behat-debug-bundle
  • Enable bundle in your AppKernel:
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        if ($this->getEnvironment == 'test') {
            $bundles = array(
                // ...
                new FilipGolonka\SymfonyBehatDebugBundle\FilipGolonkaSymfonyBehatDebugBundle(),
            );

            // ...
        }
    }
}
  • Import services configuration file to your application:
// app/config/services.yml
imports:
    - { resource: "@FilipGolonkaSymfonyBehatDebugBundle/Resources/config/services.yml" }
  • Just use it in your behat contexts:
<?php

namespace AppBundle;

use Behat\Symfony2Extension\Context\KernelAwareContext;
use Behat\Symfony2Extension\Context\KernelDictionary;

class DataContext implements KernelAwareContext
{
    use KernelDictionary;

    /**
     * @Then test difference formatting
     */
    public function testDifferenceFormatting()
    {

        $expectedContent = ['foo' => 'bar'];
        $actualContent = ['baz' => 'bat'];

        if ($expectedContent != $actualContent) {
            throw new \Exception(
                $this->getContainer()->get('behat_debug.formatter')->format(
                    $this->getContainer()->get('behat_debug.differ')->compare($expectedContent, $actualContent)
                )
            );
        }
    }
}

The Versions

28/11 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

by Filip Golonka

debug bdd tdd symfony behat specification feature storybdd

28/11 2017

0.3

0.3.0.0

  Sources   Download

MIT

The Requires

 

by Filip Golonka

debug bdd tdd symfony behat specification feature storybdd

18/07 2016

0.2

0.2.0.0

  Sources   Download

MIT

The Requires

 

by Filip Golonka

debug bdd tdd symfony behat specification feature storybdd

18/07 2016

0.1

0.1.0.0

  Sources   Download

MIT

The Requires

 

by Filip Golonka

debug bdd tdd symfony behat specification feature storybdd