NodeContext   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 20
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A visitPage() 0 7 1
1
<?php
2
/**
3
 * @author Sergii Bondarenko, <[email protected]>
4
 */
5
namespace Drupal\TqExtension\Context\Node;
6
7
class NodeContext extends RawNodeContext
8
{
9
    /**
10
     * @param string $operation
11
     *   Allowable values: "edit", "view", "visit".
12
     * @param string $nid
13
     *   Node ID or inaccurate title.
14
     * @param string $contentType
15
     *   Content type, for additional filter of a search query.
16
     *
17
     * @When /^(?:|I )(visit|view|edit) (?:the "([^"]+)"|current) node(?:| of type "([^"]+)")$/
18
     */
19
    public function visitPage($operation, $nid = '', $contentType = '')
20
    {
21
        // This helps us restrict an access for editing for users without correct permissions.
22
        // Will check for 403 HTTP status code.
23
        $this->getRedirectContext()
24
            ->visitPage($this->entityUrl($operation, $nid, $contentType));
25
    }
26
}
27