@@ 25-51 (lines=27) @@ | ||
22 | * Usage: |
|
23 | * $this->shouldBeAReadNotificationStatus();. |
|
24 | */ |
|
25 | class ReadNotificationStatusMatcher extends BasicMatcher |
|
26 | { |
|
27 | protected function matches($subject, array $arguments) : bool |
|
28 | { |
|
29 | return $subject->status() === 'read'; |
|
30 | } |
|
31 | ||
32 | protected function getFailureException($name, $subject, array $arguments) : FailureException |
|
33 | { |
|
34 | return new FailureException( |
|
35 | sprintf( |
|
36 | 'Expected a "read" notification status. Found a "%s" notification status.', |
|
37 | $subject->status() |
|
38 | ) |
|
39 | ); |
|
40 | } |
|
41 | ||
42 | protected function getNegativeFailureException($name, $subject, array $arguments) : FailureException |
|
43 | { |
|
44 | return $this->getFailureException($name, $subject, $arguments); |
|
45 | } |
|
46 | ||
47 | public function supports($name, $subject, array $arguments) : bool |
|
48 | { |
|
49 | return $name === 'beAReadNotificationStatus' && $subject instanceof NotificationStatus; |
|
50 | } |
|
51 | } |
|
52 |
@@ 25-51 (lines=27) @@ | ||
22 | * Usage: |
|
23 | * $this->shouldBeAnUnreadNotificationStatus();. |
|
24 | */ |
|
25 | class UnreadNotificationStatusMatcher extends BasicMatcher |
|
26 | { |
|
27 | protected function matches($subject, array $arguments) : bool |
|
28 | { |
|
29 | return $subject->status() === 'unread'; |
|
30 | } |
|
31 | ||
32 | protected function getFailureException($name, $subject, array $arguments) : FailureException |
|
33 | { |
|
34 | return new FailureException( |
|
35 | sprintf( |
|
36 | 'Expected a "unread" notification status. Found a "%s" notification status.', |
|
37 | $subject->status() |
|
38 | ) |
|
39 | ); |
|
40 | } |
|
41 | ||
42 | protected function getNegativeFailureException($name, $subject, array $arguments) : FailureException |
|
43 | { |
|
44 | return $this->getFailureException($name, $subject, $arguments); |
|
45 | } |
|
46 | ||
47 | public function supports($name, $subject, array $arguments) : bool |
|
48 | { |
|
49 | return $name === 'beAnUnreadNotificationStatus' && $subject instanceof NotificationStatus; |
|
50 | } |
|
51 | } |
|
52 |