PHP code example of ivans083 / behatformatter

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

    

ivans083 / behatformatter example snippets


# FeatureContext.php
class FeatureContext extends MinkContext
{
...
}

# FeatureContext.php
class FeatureContext extends elkan\BehatFormatter\Context\BehatFormatterContext
{
...
}

    /**
     * @BeforeScenario
     */
    public function createTransformValues(){
        $this->setTransformValues(array(
            "<test>" => "A simple test value",
            "<timestamp>" => time()
        ));
    }

  @test
  Scenario: Sign up for the newsletter
    When I fill in "email" with "test+<timestamp>[email protected]"
    And I press "Sign up"

  @test
  Scenario: Sign up for the newsletter
    When I fill in "email" with "[email protected]"
    And I press "Sign up"