Completed
Push — master ( e8d24b...664609 )
by Sergii
03:19
created

RawMessageContext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessagesContainers() 0 10 2
1
<?php
2
/**
3
 * @author Sergii Bondarenko, <[email protected]>
4
 */
5
namespace Drupal\TqExtension\Context\Message;
6
7
// Helpers.
8
use Behat\Mink\Element\NodeElement;
9
10
// Contexts.
11
use Drupal\TqExtension\Context\RawTqContext;
12
13
class RawMessageContext extends RawTqContext
14
{
15
    /**
16
     * @param string $type
17
     *   Message type: "error", "warning", "success" or nothing.
18
     *
19
     * @return NodeElement[]
20
     */
21
    protected function getMessagesContainers($type = '')
22
    {
23
        if ('' !== $type) {
24
            $type .= '_';
25
        }
26
27
        return $this->getSession()
28
            ->getPage()
29
            ->findAll('css', $selector = $this->getDrupalSelector($type . 'message_selector'));
30
    }
31
}
32