Code Duplication    Length = 12-12 lines in 3 locations

src/Context/JsonContext.php 3 locations

@@ 53-64 (lines=12) @@
50
     *
51
     * @Then the JSON node :node should be equal to :text
52
     */
53
    public function theJsonNodeShouldBeEqualTo($node, $text)
54
    {
55
        $json = $this->getJson();
56
57
        $actual = $this->inspector->evaluate($json, $node);
58
59
        if ($actual != $text) {
60
            throw new \Exception(
61
                sprintf("The node value is '%s'", json_encode($actual))
62
            );
63
        }
64
    }
65
66
    /**
67
     * Checks, that given JSON nodes are equal to givens values
@@ 149-160 (lines=12) @@
146
     *
147
     * @Then the JSON node :node should be equal to the string :text
148
     */
149
    public function theJsonNodeShouldBeEqualToTheString($node, $text)
150
    {
151
        $json = $this->getJson();
152
153
        $actual = $this->inspector->evaluate($json, $node);
154
155
        if ($actual !== $text) {
156
            throw new \Exception(
157
                sprintf('The node value is `%s`', json_encode($actual))
158
            );
159
        }
160
    }
161
162
    /**
163
     * Checks, that given JSON node is equal to the given number
@@ 167-178 (lines=12) @@
164
     *
165
     * @Then the JSON node :node should be equal to the number :number
166
     */
167
    public function theJsonNodeShouldBeEqualToTheNumber($node, $number)
168
    {
169
        $json = $this->getJson();
170
171
        $actual = $this->inspector->evaluate($json, $node);
172
173
        if ($actual !== (float) $number && $actual !== (int) $number) {
174
            throw new \Exception(
175
                sprintf('The node value is `%s`', json_encode($actual))
176
            );
177
        }
178
    }
179
180
    /**
181
     * Checks, that given JSON node has N element(s)