1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Sylius package. |
5
|
|
|
* |
6
|
|
|
* (c) Paweł Jędrzejewski |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
declare(strict_types=1); |
13
|
|
|
|
14
|
|
|
namespace Sylius\Behat\Context\Ui\Admin; |
15
|
|
|
|
16
|
|
|
use Behat\Behat\Context\Context; |
17
|
|
|
use Sylius\Behat\NotificationType; |
18
|
|
|
use Sylius\Behat\Page\Admin\Taxon\CreatePageInterface; |
19
|
|
|
use Sylius\Behat\Service\NotificationCheckerInterface; |
20
|
|
|
use Sylius\Component\Core\Model\PromotionInterface; |
21
|
|
|
|
22
|
|
|
final class RemovingTaxonContext implements Context |
23
|
|
|
{ |
24
|
|
|
/** @var CreatePageInterface */ |
25
|
|
|
private $createPage; |
26
|
|
|
|
27
|
|
|
/** @var NotificationCheckerInterface */ |
28
|
|
|
private $notificationChecker; |
29
|
|
|
|
30
|
|
|
public function __construct(CreatePageInterface $createPage, NotificationCheckerInterface $notificationChecker) |
31
|
|
|
{ |
32
|
|
|
$this->createPage = $createPage; |
33
|
|
|
$this->notificationChecker = $notificationChecker; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @When I remove taxon named :name |
38
|
|
|
* @When I delete taxon named :name |
39
|
|
|
*/ |
40
|
|
|
public function iRemoveTaxonNamed(string $name): void |
41
|
|
|
{ |
42
|
|
|
$this->createPage->open(); |
43
|
|
|
$this->createPage->deleteTaxonOnPageByName($name); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @Then I should be notified that :promotion promotion has been updated |
48
|
|
|
*/ |
49
|
|
|
public function iShouldBeNotifiedThatPromotionHasBeenUpdated(PromotionInterface $promotion): void |
50
|
|
|
{ |
51
|
|
|
$this->notificationChecker->checkNotification( |
52
|
|
|
sprintf('Some rules of the promotions with codes %s have been updated.', $promotion->getCode()), |
53
|
|
|
NotificationType::info() |
54
|
|
|
); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|