Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types=1);
- namespace Thengine\Behat\Context\Domain\Tariff\Model;
- use Behat\Behat\Context\Context
- use Thengine\Domain\Tariff\Model\Tariff;
- use Thengine\Domain\Tariff\Model\TariffCategory;
- use Thengine\Domain\Tariff\Exception\CannotRemoveCategoryException;
- use Thengine\Test\Assert\Exception\ExpectationFailedException;
- final class TariffContext implements Context
- {
- // ..
- /**
- * @Then I should not be able to remove the tariff ":tariff" from category ":tariffCategory"
- */
- public function expectCannotRemoveCategoryException(Tariff $tariff, TariffCategory $tariffCategory)
- {
- $this->manager->refresh($tariff);
- $this->manager->refresh($tariffCategory);
- try {
- $tariffCategory->removeTariff($tariff);
- throw new ExpectationFailedException('The category should not be removable.');
- } catch (CannotRemoveCategoryException $e) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement