Code Duplication    Length = 9-9 lines in 3 locations

eZ/Bundle/EzPublishRestBundle/Features/Context/SubContext/Exception.php 3 locations

@@ 28-36 (lines=9) @@
25
    /**
26
     * @Then response has (an) invalid field exception/error
27
     */
28
    public function assertInvalidFieldException()
29
    {
30
        $this->assertStatusCode(403);
31
        $this->assertStatusMessage('Forbidden');
32
        $this->assertHeaderHasObject('content-type', 'ErrorMessage');
33
        $this->assertResponseObject('eZ\\Publish\\Core\\REST\\Common\\Exceptions\\ForbiddenException');
34
        $this->assertResponseErrorStatusCode(403);
35
        $this->assertResponseErrorDescription("/^Argument '([^']+)' is invalid:(.+)\$/");
36
    }
37
38
    /**
39
     * @Then response has a forbidden exception/error with message :message
@@ 41-49 (lines=9) @@
38
    /**
39
     * @Then response has a forbidden exception/error with message :message
40
     */
41
    public function assertForbiddenExceptionWithMessage($message)
42
    {
43
        $this->assertStatusCode(403);
44
        $this->assertStatusMessage('Forbidden');
45
        $this->assertHeaderHasObject('content-type', 'ErrorMessage');
46
        $this->assertResponseObject('eZ\\Publish\\Core\\REST\\Common\\Exceptions\\ForbiddenException');
47
        $this->assertResponseErrorStatusCode(403);
48
        $this->assertResponseErrorDescription("/^$message\$/");
49
    }
50
51
    /**
52
     * @Then response has (a) not found exception/error
@@ 54-62 (lines=9) @@
51
    /**
52
     * @Then response has (a) not found exception/error
53
     */
54
    public function assertNotFoundException()
55
    {
56
        $this->assertStatusCode(404);
57
        $this->assertStatusMessage('Not Found');
58
        $this->assertHeaderHasObject('content-type', 'ErrorMessage');
59
        $this->assertResponseObject('eZ\\Publish\\Core\\REST\\Common\\Exceptions\\NotFoundException');
60
        $this->assertResponseErrorStatusCode(404);
61
        $this->assertResponseErrorDescription("/^Could not find '([^']+)' with identifier '([^']+)'\$/");
62
    }
63
}
64