Test-Driven Development with PHP 8 by Rainier Sarabia

Test-Driven Development with PHP 8 by Rainier Sarabia

Author:Rainier Sarabia
Language: eng
Format: epub
Publisher: Packt
Published: 2023-10-15T00:00:00+00:00


Figure 6.5 – Automatically generated snippets

Behat has automatically generated the PHP snippets needed to represent the Given, When, and Then steps we have defined inside the home.feature file.

Open the HomeContext.php class we created earlier, and there you should see the new automatically generated methods:<?php

use Behat\Behat\Tester\Exception\PendingException;

class HomeContext implements \Behat\Behat\Context

\Context

{

/**

* @Given I have access to the home page URL

*/

public function iHaveAccessToTheHomePageUrl()

{

throw new PendingException();

}

/**

* @When I visit the home page

*/

public function iVisitTheHomePage()

{

throw new PendingException();

}

/**

* @Then I should see the Symfony Logo

*/

public function iShouldSeeTheSymfonyLogo()

{

throw new Exception();

}

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.