Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Bundle/EzPublishRestBundle/Features/Context/SubContext/Exception.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext;
8
9 trait Exception
10 {
15 public function iSeeNotAuthorizedException()
16 {
17 $this->assertStatusCode(401);
18 $this->assertStatusMessage('Unauthorized');
19 }
20
24 public function assertInvalidFieldException()
25 {
26 $this->assertStatusCode(403);
27 $this->assertStatusMessage('Forbidden');
28 $this->assertHeaderHasObject('content-type', 'ErrorMessage');
29 $this->assertResponseObject('eZ\\Publish\\Core\\REST\\Common\\Exceptions\\ForbiddenException');
30 $this->assertResponseErrorStatusCode(403);
31 $this->assertResponseErrorDescription("/^Argument '([^']+)' is invalid:(.+)\$/");
32 }
33
37 public function assertForbiddenExceptionWithMessage($message)
38 {
39 $this->assertStatusCode(403);
40 $this->assertStatusMessage('Forbidden');
41 $this->assertHeaderHasObject('content-type', 'ErrorMessage');
42 $this->assertResponseObject('eZ\\Publish\\Core\\REST\\Common\\Exceptions\\ForbiddenException');
43 $this->assertResponseErrorStatusCode(403);
44 $this->assertResponseErrorDescription("/^$message\$/");
45 }
46
50 public function assertNotFoundException()
51 {
52 $this->assertStatusCode(404);
53 $this->assertStatusMessage('Not Found');
54 $this->assertHeaderHasObject('content-type', 'ErrorMessage');
55 $this->assertResponseObject('eZ\\Publish\\Core\\REST\\Common\\Exceptions\\NotFoundException');
56 $this->assertResponseErrorStatusCode(404);
57 $this->assertResponseErrorDescription("/^Could not find '([^']+)' with identifier '([^']+)'\$/");
58 }
59 }
eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext
Definition: Authentication.php:7
eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\assertResponseErrorDescription
assertResponseErrorDescription($errorDescriptionRegEx)
@Then response error description is :errorDescriptionRegEx
Definition: EzRest.php:79
eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\assertResponseObject
assertResponseObject($object)
@Then response has/contains a(n) :object object
Definition: EzRest.php:139
eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\assertHeaderHasObject
assertHeaderHasObject($header, $object)
@Then response header :header has/contains :object (object)
Definition: EzRest.php:53
eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\assertResponseErrorStatusCode
assertResponseErrorStatusCode($code)
@Then response error status code is :code
Definition: EzRest.php:65
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.