Skip to content

Commit

Permalink
Fixed the tests with property type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Jan 26, 2024
1 parent 512e899 commit 57f9532
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/ClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class ClientBuilderTest extends TestCase
{
protected ClientInterface $httpClient;
protected LoggerInterface $logger;

protected HttpAsyncClient $asyncHttpClient;
protected NodePoolInterface $nodePool;
protected Psr17Factory $psr17Factory;
protected ClientBuilder $builder;

public function setUp(): void
{
$this->httpClient = $this->createStub(ClientInterface::class);
Expand Down
7 changes: 7 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Elastic\Elasticsearch\Exception\ServerResponseException;
use Elastic\Elasticsearch\Response\Elasticsearch;
use Elastic\Transport\NodePool\NodePoolInterface;
use Elastic\Transport\Transport;
use Elastic\Transport\TransportBuilder;
use Http\Mock\Client as MockClient;
use Http\Promise\Promise;
Expand All @@ -29,6 +30,12 @@

class ClientTest extends TestCase
{
protected LoggerInterface $logger;
protected MockClient $httpClient;
protected Transport $transport;
protected Psr17Factory $psr17Factory;
protected Client $client;

public function setUp(): void
{
$this->logger = $this->createStub(LoggerInterface::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Elastic\Elasticsearch\Tests\Integration;

use Elastic\Elasticsearch\Client;
use Elastic\Elasticsearch\Tests\Utility;
use PHPUnit\Framework\TestCase;

Expand All @@ -22,6 +23,8 @@
*/
class BasicTest extends TestCase
{
protected Client $client;

public function setUp(): void
{
$this->client = Utility::getClient();
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/BulkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class BulkTest extends TestCase
{
const TEST_INDEX = 'test';

protected Client $client;

public function setUp(): void
{
$this->client = Utility::getClient();
Expand Down
2 changes: 2 additions & 0 deletions tests/Integration/MlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class MlTest extends TestCase
{
const JOB_ID = 'total-requests';

protected Client $client;

public function setUp(): void
{
$this->client = Utility::getClient();
Expand Down
7 changes: 7 additions & 0 deletions tests/Response/ElasticsearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@
use Elastic\Elasticsearch\Response\Elasticsearch;
use Nyholm\Psr7\Factory\Psr17Factory;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;

class ElasticsearchTest extends TestCase
{
protected Psr17Factory $psr17Factory;
protected ResponseInterface $elasticsearch;
protected ResponseInterface $response200;
protected ResponseInterface $response400;
protected ResponseInterface $response500;

public function setUp(): void
{
$this->psr17Factory = new Psr17Factory();
Expand Down
1 change: 1 addition & 0 deletions tests/Transport/Adapter/GuzzleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
class GuzzleTest extends TestCase
{
protected Guzzle $guzzleAdapter;
protected ClientInterface $client;

public function setUp(): void
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Transport/Adapter/SymfonyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
class SymfonyTest extends TestCase
{
protected Symfony $symfonyAdapter;

protected ClientInterface $client;

public function setUp(): void
{
$this->symfonyAdapter = new Symfony;
Expand Down
3 changes: 3 additions & 0 deletions tests/Transport/AsyncOnSuccessNoExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

class AsyncOnSuccessNoExceptionTest extends TestCase
{
protected Psr17Factory $psr17Factory;
protected AsyncOnSuccessNoException $asyncOnSuccess;

public function setUp(): void
{
$this->asyncOnSuccess = new AsyncOnSuccessNoException();
Expand Down
3 changes: 3 additions & 0 deletions tests/Transport/AsyncOnSuccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

class AsyncOnSuccessTest extends TestCase
{
protected Psr17Factory $psr17Factory;
protected AsyncOnSuccess $asyncOnSuccess;

public function setUp(): void
{
$this->asyncOnSuccess = new AsyncOnSuccess();
Expand Down

0 comments on commit 57f9532

Please sign in to comment.