2017 © Pedro Peláez
 

library mink-legacy-driver

Driver for Mink/Behat providing a bridge for legacy applications

image

carlosv2/mink-legacy-driver

Driver for Mink/Behat providing a bridge for legacy applications

  • Sunday, March 12, 2017
  • by carlosV2
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

mink-legacy-driver

This project aims to provide a bridge between Mink and legacy apps. In general terms, legacy apps are not written with the best practices in mind or they are too old to support them., (*1)

License Build Status SensioLabsInsight, (*2)

Why?

Legacy apps are hard to maintain mainly because of the lack of tests or because of very slow and painful tests. This situation produces fear to change as the side effects are unknown. In addition to this, legacy apps use to suffer from the following situations:, (*3)

  • No usage of composer autoload.
  • Rely on PHP superglobals (like $_GET, $_POST, $_SERVER, etc).
  • Having many frontend controllers.
  • Usage of exit/die to abruptly finish the request.

Installation

Install with:, (*4)

$ composer require --dev carlosv2/mink-legacy-driver

Usage

Set up your behat.yml file as follows:, (*5)

default:
  extensions:
    carlosV2\LegacyDriver\Extension: ~
    Behat\MinkExtension:
      sessions:
        default:
          legacy:
            environment: <array>
            controller: <string|array>
            document_root: <string>
            bootstrap: <string|array>

Where:, (*6)

  • environment: Key/value array containing the environment variables. For example:, (*7)

    environment:
    variable: value
    env: prod
    
  • controller: Location of the frontend controller. For example:, (*8)

    controller: path/to/the/controller.php
    

    Alternatively you can supply an array of frontend controllers. For example:, (*9)

    controller:
    - path: /uri/to/match
      file: path/to/the/uri/to/match.php
    - path: /uri/to/another
      file: another/path/to/match.php    
    

    The controllers key configures the symfony/routing component underneath. As a result, you can also add the methods and requirements keys. For example:, (*10)

    controller:
    - path: /item/{id}
      file: process_item.php
      methods: ["GET", "PUT"]
      requirements:
        id: \d+
    
  • document_root: Location of the document root. For example:, (*11)

    document_root: path/to/the/document/root/
    
  • bootstrap: Location of the bootstrap file to execute before every request. For example:, (*12)

    bootstrap: path/to/the/bootstrap/file.php
    

    Alternatively you can supply multiple files to be executed before every request. For example:, (*13)

    bootstrap:
    - path/to/the/bootstrap/file.php
    - another/path/to/bootstrap.php
    

The Versions

12/03 2017

dev-master

9999999-dev

Driver for Mink/Behat providing a bridge for legacy applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carlos Ortega
by Jon Acker

testing behat legacy browser mink headless

26/02 2017

1.0.0

1.0.0.0

Driver for Mink/Behat providing a bridge for legacy applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carlos Ortega
by Jon Acker

testing behat legacy browser mink headless