How to use Behat in Cake Php?

Viewed 39

I have this feature

Feature: User accesses Appointments Dashboard

Scenario:
Given I am on "User Dashboard Page"
And I should see "APPOINTMENTS"
And I should see "PRE-ENROLMENTS"
When I press "APPOINTMENTS"
Then I am on "Appointments Dashboard"
And I should see "Booking Reference"
And I should see "Book Another Appointment"

And I have these steps

--- FeatureContext has missing steps. Define them with these snippets:

/**
 * @Given I am on :arg1
 */
public function iAmOn($arg1)
{
    throw new PendingException();
}

/**
 * @Given I should see :arg1
 */
public function iShouldSee($arg1)
{
    throw new PendingException();
}

/**
 * @When I press :arg1
 */
public function iPress($arg1)
{
    throw new PendingException();
}

How do I complete the steps and run it with Behat in Cake Php ? So, that my tests pass ??

1 Answers

If you want access to yuor CakePHP internals, then you'll probably want to have an instance of CakePHP application in your Context (e.g. App\Application or Cake\Http\Server, look at your index.php on it's done). Then, hopefully you'll be able to access all of the usual application internals via default Service Container of CakePHP.

Related