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

IntegrationTestRepository.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Client;
8
9 use eZ\Publish\API\Repository\Values\User\UserReference;
10 use eZ\Publish\Core\REST\Common\RequestParser;
11 use eZ\Publish\Core\REST\Common\Input\Dispatcher;
12 use eZ\Publish\Core\REST\Common\Output\Visitor;
13 use eZ\Publish\Core\REST\Client\HttpClient\Authentication\IntegrationTestAuthenticator;
14
22 class IntegrationTestRepository extends Repository implements Sessionable
23 {
29 private $authenticator;
30
36 private $client;
37
43 private $currentUser;
44
54 public function __construct(HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, RequestParser $requestParser, array $fieldTypes, IntegrationTestAuthenticator $authenticator)
55 {
56 parent::__construct($client, $inputDispatcher, $outputVisitor, $requestParser, $fieldTypes);
57 $this->client = $client;
58 $this->authenticator = $authenticator;
59 }
60
70 public function setSession($id)
71 {
72 if ($this->client instanceof Sessionable) {
73 $this->client->setSession($id);
74 }
75 }
76
82 public function getCurrentUser()
83 {
84 return $this->currentUser;
85 }
86
94 public function setCurrentUser(UserReference $user)
95 {
96 $this->currentUser = $user;
97 $this->authenticator->setUserId($user->getUserId());
98 }
99 }
eZ\Publish\Core\REST\Client\HttpClient\Authentication\IntegrationTestAuthenticator
Authenticator used in integration tests.
Definition: IntegrationTestAuthenticator.php:19
eZ\Publish\Core\REST\Client\IntegrationTestRepository
REST Client Repository to be used in integration tests.
Definition: IntegrationTestRepository.php:23
eZ\Publish\Core\REST\Client\IntegrationTestRepository\setSession
setSession($id)
Set session ID.
Definition: IntegrationTestRepository.php:70
eZ\Publish\Core\REST\Client\IntegrationTestRepository\$authenticator
$authenticator
Definition: IntegrationTestRepository.php:29
eZ\Publish\Core\REST\Client\IntegrationTestRepository\__construct
__construct(HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, RequestParser $requestParser, array $fieldTypes, IntegrationTestAuthenticator $authenticator)
Instantiates the REST Client repository.
Definition: IntegrationTestRepository.php:54
eZ\Publish\Core\REST\Client\IntegrationTestRepository\$client
$client
Definition: IntegrationTestRepository.php:36
eZ\Publish\Core\REST\Client\IntegrationTestRepository\$currentUser
$currentUser
Definition: IntegrationTestRepository.php:43
eZ\Publish\Core\REST\Client\IntegrationTestRepository\getCurrentUser
getCurrentUser()
Get current user.
Definition: IntegrationTestRepository.php:82
eZ\Publish\Core\REST\Client\IntegrationTestRepository\setCurrentUser
setCurrentUser(UserReference $user)
Sets the current user to the given $user.
Definition: IntegrationTestRepository.php:94
eZ\Publish\Core\REST\Client\Repository
REST Client Repository.
Definition: Core/REST/Client/Repository.php:20
eZ\Publish\Core\REST\Client\Repository\$fieldTypes
$fieldTypes
Definition: Core/REST/Client/Repository.php:78
eZ\Publish\Core\REST\Client\Repository\$requestParser
$requestParser
Definition: Core/REST/Client/Repository.php:75
eZ\Publish\Core\REST\Client\Repository\$inputDispatcher
$inputDispatcher
Definition: Core/REST/Client/Repository.php:69
eZ\Publish\Core\REST\Client\Repository\$outputVisitor
$outputVisitor
Definition: Core/REST/Client/Repository.php:72
eZ\Publish\Core\REST\Common\Input\Dispatcher
Input dispatcher.
Definition: Dispatcher.php:16
eZ\Publish\Core\REST\Common\Output\Visitor
Visits a value object into an HTTP Response.
Definition: Visitor.php:15
eZ\Publish\API\Repository\Values\User\UserReference
This interface represents a user reference for use in sessions and Repository.
Definition: API/Repository/Values/User/UserReference.php:13
eZ\Publish\API\Repository\Values\User\UserReference\getUserId
getUserId()
The User id of the User this reference represent.
eZ\Publish\Core\REST\Client\HttpClient
Interface for Http Client implementations.
Definition: REST/Client/HttpClient.php:15
eZ\Publish\Core\REST\Client\Sessionable
Implementation of the \eZ\Publish\API\Repository\SectionService interface.
Definition: Sessionable.php:16
eZ\Publish\Core\REST\Common\RequestParser
Interface for Request parsers.
Definition: RequestParser.php:13
eZ\Publish\Core\REST\Client
Definition: Core/REST/Client/ContentService.php:7
eZ\Publish\Core\REST\Common\RequestParser
Definition: EzPublish.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.