PHP code example of cevinio / behat-laravel-extension

1. Go to this page and download the library: Download cevinio/behat-laravel-extension library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cevinio / behat-laravel-extension example snippets



use Behat\Behat\EventDispatcher\Event\BeforeScenarioTested;
use Behat\MinkExtension\Context\MinkContext;
use Cevinio\Behat\Context\LaravelAware;
use Cevinio\Behat\Context\LaravelAwareContext;
use Illuminate\Contracts\Foundation\Application;

/**
 * Defines application features from the specific context.
 */
class FeatureContext extends MinkContext implements LaravelAwareContext
{
    use LaravelAware;

    public function bootstrapLaravelEnvironment(BeforeScenarioTested $event): array
    {
        // This method is optional, if implemented the returned array is set in the Laravel environment for access via env().
        // This allows modification of configuration values on a per-scenario basis.
    }

    public function bootstrapLaravelApplication(Application $app, BeforeScenarioTested $event): void
    {
        // This method is optional. It allows access to the Application right after it was created.
        // This allows for example to call $app->bind() before any @BeforeScenario hook is called. 
    }