Completed
Push — master ( 6f962e...f87bab )
by Paweł
15s
created

NotificationContext   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 39
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A iShouldBeNotifiedItHasBeenSuccessfullyCreated() 0 4 1
A iShouldBeNotifiedThatItHasBeenSuccessfullyEdited() 0 4 1
A iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted() 0 4 1
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
namespace Sylius\Behat\Context\Ui\Admin;
13
14
use Behat\Behat\Context\Context;
15
use Sylius\Behat\NotificationType;
16
use Sylius\Behat\Service\NotificationCheckerInterface;
17
18
/**
19
 * @author Arkadiusz Krakowiak <[email protected]>
20
 */
21
final class NotificationContext implements Context
22
{
23
    /**
24
     * @var NotificationCheckerInterface
25
     */
26
    private $notificationChecker;
27
28
    /**
29
     * @param NotificationCheckerInterface $notificationChecker
30
     */
31
    public function __construct(NotificationCheckerInterface $notificationChecker)
32
    {
33
        $this->notificationChecker = $notificationChecker;
34
    }
35
36
    /**
37
     * @Then I should be notified that it has been successfully created
38
     */
39
    public function iShouldBeNotifiedItHasBeenSuccessfullyCreated()
40
    {
41
        $this->notificationChecker->checkNotification('has been successfully created.', NotificationType::success());
42
    }
43
44
    /**
45
     * @Then I should be notified that it has been successfully edited
46
     */
47
    public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
48
    {
49
        $this->notificationChecker->checkNotification('has been successfully updated.', NotificationType::success());
50
    }
51
52
    /**
53
     * @Then I should be notified that it has been successfully deleted
54
     */
55
    public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted()
56
    {
57
        $this->notificationChecker->checkNotification('has been successfully deleted.', NotificationType::success());
58
    }
59
}
60