2017 © Pedro Peláez
 

library behat-mysql-dump

Uses mysqldump to dump the database out to a file when a scenario in behat fails.

image

vivait/behat-mysql-dump

Uses mysqldump to dump the database out to a file when a scenario in behat fails.

  • Tuesday, January 24, 2017
  • by Brunty
  • Repository
  • 3 Watchers
  • 1 Stars
  • 3,138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 19 % Grown

The README.md

Vivait\Behat\DbDump\Context\DbDumpContext

This context will dump a database to a file when a scenario in Behat fails., (*1)

The filename will be:, (*2)

behat-scenario-failed-{scenarioTitle}-{dateStamp}.sql, (*3)

So if you have a scenario that was run:, (*4)

Scenario: A user can perform a search with advanced filtering

The filename would be along the lines of:, (*5)

behat-scenario-failed-A user can perform a search with advanced filtering-20170124113226.sql, (*6)

Compatibility / Requirements

  • PHP 5.6 and above, 7.0 and above

Installation

composer require vivait/behat-mysql-dump --dev, (*7)

Usage

Configure Behat by adding the context to your behat.yml file, (*8)

default:
    suites:
        mysuite:
            contexts:
                - Vivait\Behat\DbDump\Context\DbDumpContext:
                    - 'database_username_here'
                    - 'database_password_here'
                    - 'database_name_here'
                    - '/output/directory/here'

If using the Behat Symfony 2 Extension you can use Symfony parameters like so:, (*9)

default:
    suites:
        mysuite:
            contexts:
                - Vivait\Behat\DbDump\Context\DbDumpContext:
                    - '%%database_user%%'
                    - '%%database_password%%'
                    - '%%database_name%%'
                    - '%%kernel.root_dir%%/logs'

Contributing

This started as a project internally that we used on some of our projects, if there's new features / ideas you think could be useful please feel free to suggest them, or submit a PR!, (*10)

Although this project is small, openness and inclusivity are taken seriously. To that end the following code of conduct has been adopted., (*11)

Contributor Code of Conduct, (*12)

The Versions

24/01 2017

dev-master

9999999-dev

Uses mysqldump to dump the database out to a file when a scenario in behat fails.

  Sources   Download

MIT

The Requires

 

24/01 2017

0.1

0.1.0.0

Uses mysqldump to dump the database out to a file when a scenario in behat fails.

  Sources   Download

MIT

The Requires