Code Duplication    Length = 7-7 lines in 3 locations

src/Json/JsonContext.php 3 locations

@@ 68-74 (lines=7) @@
65
    /**
66
     * @Then /^the JSON array node "(?P<jsonNode>[^"]*)" should contain "(?P<expectedValue>.*)" element$/
67
     */
68
    public function theJsonArrayNodeShouldContainElements($jsonNode, $expectedValue)
69
    {
70
        $this->assert(function () use ($jsonNode, $expectedValue) {
71
            $realValue = $this->evaluateJsonNodeValue($jsonNode);
72
            $this->asserter->phpArray($realValue)->contains($expectedValue);
73
        });
74
    }
75
76
    /**
77
     * @Then /^the JSON array node "(?P<jsonNode>[^"]*)" should not contain "(?P<expectedValue>.*)" element$/
@@ 90-96 (lines=7) @@
87
    /**
88
     * @Then /^the JSON node "(?P<jsonNode>[^"]*)" should contain "(?P<expectedValue>.*)"$/
89
     */
90
    public function theJsonNodeShouldContain($jsonNode, $expectedValue)
91
    {
92
        $this->assert(function () use ($jsonNode, $expectedValue) {
93
            $realValue = $this->evaluateJsonNodeValue($jsonNode);
94
            $this->asserter->string((string) $realValue)->contains($expectedValue);
95
        });
96
    }
97
98
    /**
99
     * Checks, that given JSON node does not contain given value
@@ 103-109 (lines=7) @@
100
     *
101
     * @Then /^the JSON node "(?P<jsonNode>[^"]*)" should not contain "(?P<unexpectedValue>.*)"$/
102
     */
103
    public function theJsonNodeShouldNotContain($jsonNode, $unexpectedValue)
104
    {
105
        $this->assert(function () use ($jsonNode, $unexpectedValue) {
106
            $realValue = $this->evaluateJsonNodeValue($jsonNode);
107
            $this->asserter->string((string) $realValue)->notContains($unexpectedValue);
108
        });
109
    }
110
111
    /**
112
     * Checks, that given JSON node exist