/** * @param string $expectedNotification */ private function assertNotification($expectedNotification) { $notifications = $this->orderDetails->getNotifications(); $hasNotifications = ''; foreach ($notifications as $notification) { $hasNotifications .= $notification; if ($notification === $expectedNotification) { return; } } throw new \RuntimeException(sprintf('There is no notificaiton with "%s". Got "%s"', $expectedNotification, $hasNotifications)); }
/** * @Then I should not be able to pay */ public function iShouldNotBeAbleToPayAgain() { Assert::false($this->orderDetails->hasPayAction(), 'I should not be able to pay, but I am able to.'); }
/** * @Given /^I tried to pay(?:| again)$/ * @When /^I try to pay(?:| again)$/ */ public function iTryToPayAgain() { $this->paypalApiMocker->performActionInApiInitializeScope(function () { $this->orderDetails->pay(); }); }