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

Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext Class Reference

RestContext is the core of the REST testing All SubContext (traits), helpers are loaded here Settings and client initializations is done here Also it contains all REST generic actions. More...

Inheritance diagram for eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext:

## Public Member Functions
| __construct ( $driver=self::DEFAULT_DRIVER, $type=self::DEFAULT_BODY_TYPE, $authType=self::DEFAULT_AUTH_TYPE)
| Initialize class. More...
| setMink (Mink $mink)
| Sets Mink instance. More...
| setMinkParameters (array $parameters)
| Sets parameters provided for Mink. More...
| createRequest ($type, $resource)
| @When I create a :type request to :resource (url) More...
| createAndSendRequest ($type, $resource)
| @When I send a :type request to :resource (url) More...
| setHeader ($header, $value)
| @When I set :header header with :value (value) More...
| setHeaders (TableNode $table)
| @When I set headers: More...
| sendRequest ()
| @When I send the request More...
| assertStatusCode ($code)
| @Then response status code is :code More...
| assertStatusMessage ($message)
| @Then response status message is :message More...
| existResponseHeader ($header)
| @Then response header :header exist More...
| dontExistResponseHeader ($header)
| @Then response header :header don't exist More...
| assertHeaderHaveValue ($header, $value)
| @Then response header :header have :value (value) More...
| assertHeaderDontHaveValue ($header, $value)
| @Then response header :header don't have :value (value) More...
| responseBodyHasValue ($value)
| @Then response body has :value (value) More...

## Public Attributes
const | AUTHTYPE_BASICHTTP = 'http_basic'
const | AUTHTYPE_SESSION = 'session'
const | DEFAULT_URL = 'http://localhost/'
const | DEFAULT_DRIVER = 'GuzzleDriver'
const | DEFAULT_BODY_TYPE = 'json'
const | DEFAULT_AUTH_TYPE = self::AUTHTYPE_SESSION

## Protected Attributes
| $restDriver

## Private Member Functions
| setUrl ($url)
| resetDriver ()
| @BeforeScenario More...
| setRestDriver ($restDriver)
| Create and set the REST driver to be used. More...

## Private Attributes
| $url
| $driver
| $mink
| $minkParameters

## Detailed Description

RestContext is the core of the REST testing All SubContext (traits), helpers are loaded here Settings and client initializations is done here Also it contains all REST generic actions.

Definition at line 25 of file RestContext.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::__construct | ( |  | $driver = `self::DEFAULT_DRIVER`,
|  |  | $type = `self::DEFAULT_BODY_TYPE`,
|  |  | $authType = `self::DEFAULT_AUTH_TYPE`
| ) |  |

Initialize class.

Parameters

  string | $url | Base URL for REST calls
  string | $driver | REST Driver to be used
  string | $json |

Definition at line 69 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\$driver, and eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setRestDriver().

## Member Function Documentation

## ◆ assertHeaderDontHaveValue()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::assertHeaderDontHaveValue | ( |  | $header,
|  |  | $value
| ) |  |

@Then response header :header don't have :value (value)

Definition at line 298 of file RestContext.php.

## ◆ assertHeaderHaveValue()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::assertHeaderHaveValue | ( |  | $header,
|  |  | $value
| ) |  |

@Then response header :header have :value (value)

Definition at line 286 of file RestContext.php.

## ◆ assertStatusCode()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::assertStatusCode | ( |  | $code | ) |

@Then response status code is :code

Definition at line 204 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\getResponseObject().

## ◆ assertStatusMessage()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::assertStatusMessage | ( |  | $message | ) |

@Then response status message is :message

Definition at line 252 of file RestContext.php.

## ◆ createAndSendRequest()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::createAndSendRequest | ( |  | $type,
|  |  | $resource
| ) |  |

@When I send a :type request to :resource (url)

Definition at line 160 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\createRequest().

## ◆ createRequest()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::createRequest | ( |  | $type,
|  |  | $resource
| ) |  |

@When I create a :type request to :resource (url)

Definition at line 148 of file RestContext.php.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\createAndSendRequest().

## ◆ dontExistResponseHeader()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::dontExistResponseHeader | ( |  | $header | ) |

@Then response header :header don't exist

Definition at line 275 of file RestContext.php.

## ◆ existResponseHeader()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::existResponseHeader | ( |  | $header | ) |

@Then response header :header exist

Definition at line 264 of file RestContext.php.

## ◆ resetDriver()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::resetDriver | ( |  | ) |
| private

@BeforeScenario

Definition at line 114 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setRestDriver().

## ◆ responseBodyHasValue()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::responseBodyHasValue | ( |  | $value | ) |

@Then response body has :value (value)

Definition at line 310 of file RestContext.php.

## ◆ sendRequest()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::sendRequest | ( |  | ) |

@When I send the request

Definition at line 189 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\$requestObject, eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\addObjectToRequestBody(), and eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\getRequestObject().

## ◆ setHeader()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::setHeader | ( |  | $header,
|  |  | $value
| ) |  |

@When I set :header header with :value (value)

Definition at line 169 of file RestContext.php.

## ◆ setHeaders()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::setHeaders | ( | TableNode | $table | ) |

@When I set headers:

Definition at line 177 of file RestContext.php.

## ◆ setMink()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::setMink | ( | Mink | $mink | ) |

Sets Mink instance.

Parameters

  Mink | $mink | Mink session manager

Definition at line 94 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\$mink.

## ◆ setMinkParameters()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::setMinkParameters | ( | array | $parameters | ) |

Sets parameters provided for Mink.

While at it, take the base_url, and use it to build the one for the REST driver.

Parameters

  array | $parameters |

Definition at line 105 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setUrl().

## ◆ setRestDriver()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::setRestDriver | ( |  | $restDriver | ) |
| private

Create and set the REST driver to be used.

Parameters

  string | $restDriver | REST driver class name

Definition at line 124 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\$driver, and eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\$restDriver.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\__construct(), and eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\resetDriver().

## ◆ setUrl()

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::setUrl | ( |  | $url | ) |
| private

Definition at line 81 of file RestContext.php.

References eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\$url.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setMinkParameters().

## Member Data Documentation

## ◆ $driver

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::$driver
| private

Definition at line 54 of file RestContext.php.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\__construct(), and eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setRestDriver().

## ◆ $mink

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::$mink
| private

Definition at line 57 of file RestContext.php.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setMink().

## ◆ $minkParameters

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::$minkParameters
| private

Definition at line 60 of file RestContext.php.

## ◆ $restDriver

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::$restDriver
| protected

Definition at line 48 of file RestContext.php.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setRestDriver().

## ◆ $url

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::$url
| private

Definition at line 51 of file RestContext.php.

Referenced by eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext\setUrl().

## ◆ AUTHTYPE_BASICHTTP

const eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::AUTHTYPE_BASICHTTP = 'http_basic'

Definition at line 34 of file RestContext.php.

## ◆ AUTHTYPE_SESSION

const eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::AUTHTYPE_SESSION = 'session'

Definition at line 35 of file RestContext.php.

## ◆ DEFAULT_AUTH_TYPE

const eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::DEFAULT_AUTH_TYPE = self::AUTHTYPE_SESSION

Definition at line 41 of file RestContext.php.

## ◆ DEFAULT_BODY_TYPE

const eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::DEFAULT_BODY_TYPE = 'json'

Definition at line 39 of file RestContext.php.

## ◆ DEFAULT_DRIVER

const eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::DEFAULT_DRIVER = 'GuzzleDriver'

Definition at line 38 of file RestContext.php.

## ◆ DEFAULT_URL

const eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext::DEFAULT_URL = 'http://localhost/'

Definition at line 37 of file RestContext.php.

The documentation for this class was generated from the following file:

- RestContext.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.