PHP code example of mkolecki / behat-fixtures-extension

1. Go to this page and download the library: Download mkolecki/behat-fixtures-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/ */

    

mkolecki / behat-fixtures-extension example snippets



use MKolecki\Behat\FixturesExtension\Fixtures;
use Behat\Behat\Context\Context;

class LoginContext implements Context
{
    /** @var Fixtures */
    private $fixtures;

    public function __construct(Fixtures $fixtures)
    {
        $this->fixtures = $fixtures;
    }

    /**
     * @Then I login with user :user
     */
    public function iLoginWithUser($user)
    {
        $login = $this->fixtures->get("users/$user/login");
        $password = $this->fixtures->get("users/$user/password");

        // eg. use selenium to fill login form and submit
    }

    // ...
}