PHP code example of yceruto / behat-extension

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

    

yceruto / behat-extension example snippets


class FeatureContext implements Context
{
    use ExceptionAssertionTrait;

    /**
     * @Given I get a blog post with id :id
     */
    public function iGetABlogPostWithId(int $id): void
    {
        // code that gets the blog post...
    }

    /**
     * @Given I set a published date :date
     */
    public function iSetAPublishedDate(string $date): void
    {
        // code that throws an exception...
    
        throw new DomainException('The published date must be in the past.');
    }
}