Skip to content

Commit 57f9532

Browse files
committed
Fixed the tests with property type declarations
1 parent 512e899 commit 57f9532

File tree

10 files changed

+35
-2
lines changed

10 files changed

+35
-2
lines changed

tests/ClientBuilderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ class ClientBuilderTest extends TestCase
3232
{
3333
protected ClientInterface $httpClient;
3434
protected LoggerInterface $logger;
35-
35+
protected HttpAsyncClient $asyncHttpClient;
36+
protected NodePoolInterface $nodePool;
37+
protected Psr17Factory $psr17Factory;
38+
protected ClientBuilder $builder;
39+
3640
public function setUp(): void
3741
{
3842
$this->httpClient = $this->createStub(ClientInterface::class);

tests/ClientTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Elastic\Elasticsearch\Exception\ServerResponseException;
2121
use Elastic\Elasticsearch\Response\Elasticsearch;
2222
use Elastic\Transport\NodePool\NodePoolInterface;
23+
use Elastic\Transport\Transport;
2324
use Elastic\Transport\TransportBuilder;
2425
use Http\Mock\Client as MockClient;
2526
use Http\Promise\Promise;
@@ -29,6 +30,12 @@
2930

3031
class ClientTest extends TestCase
3132
{
33+
protected LoggerInterface $logger;
34+
protected MockClient $httpClient;
35+
protected Transport $transport;
36+
protected Psr17Factory $psr17Factory;
37+
protected Client $client;
38+
3239
public function setUp(): void
3340
{
3441
$this->logger = $this->createStub(LoggerInterface::class);

tests/Integration/BasicTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
namespace Elastic\Elasticsearch\Tests\Integration;
1616

17+
use Elastic\Elasticsearch\Client;
1718
use Elastic\Elasticsearch\Tests\Utility;
1819
use PHPUnit\Framework\TestCase;
1920

@@ -22,6 +23,8 @@
2223
*/
2324
class BasicTest extends TestCase
2425
{
26+
protected Client $client;
27+
2528
public function setUp(): void
2629
{
2730
$this->client = Utility::getClient();

tests/Integration/BulkTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class BulkTest extends TestCase
2424
{
2525
const TEST_INDEX = 'test';
2626

27+
protected Client $client;
28+
2729
public function setUp(): void
2830
{
2931
$this->client = Utility::getClient();

tests/Integration/MlTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class MlTest extends TestCase
2525
{
2626
const JOB_ID = 'total-requests';
2727

28+
protected Client $client;
29+
2830
public function setUp(): void
2931
{
3032
$this->client = Utility::getClient();

tests/Response/ElasticsearchTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@
2121
use Elastic\Elasticsearch\Response\Elasticsearch;
2222
use Nyholm\Psr7\Factory\Psr17Factory;
2323
use PHPUnit\Framework\TestCase;
24+
use Psr\Http\Message\ResponseInterface;
2425

2526
class ElasticsearchTest extends TestCase
2627
{
28+
protected Psr17Factory $psr17Factory;
29+
protected ResponseInterface $elasticsearch;
30+
protected ResponseInterface $response200;
31+
protected ResponseInterface $response400;
32+
protected ResponseInterface $response500;
33+
2734
public function setUp(): void
2835
{
2936
$this->psr17Factory = new Psr17Factory();

tests/Transport/Adapter/GuzzleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
class GuzzleTest extends TestCase
2525
{
2626
protected Guzzle $guzzleAdapter;
27+
protected ClientInterface $client;
2728

2829
public function setUp(): void
2930
{

tests/Transport/Adapter/SymfonyTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
class SymfonyTest extends TestCase
2626
{
2727
protected Symfony $symfonyAdapter;
28-
28+
protected ClientInterface $client;
29+
2930
public function setUp(): void
3031
{
3132
$this->symfonyAdapter = new Symfony;

tests/Transport/AsyncOnSuccessNoExceptionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
class AsyncOnSuccessNoExceptionTest extends TestCase
2323
{
24+
protected Psr17Factory $psr17Factory;
25+
protected AsyncOnSuccessNoException $asyncOnSuccess;
26+
2427
public function setUp(): void
2528
{
2629
$this->asyncOnSuccess = new AsyncOnSuccessNoException();

tests/Transport/AsyncOnSuccessTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
class AsyncOnSuccessTest extends TestCase
2525
{
26+
protected Psr17Factory $psr17Factory;
27+
protected AsyncOnSuccess $asyncOnSuccess;
28+
2629
public function setUp(): void
2730
{
2831
$this->asyncOnSuccess = new AsyncOnSuccess();

0 commit comments

Comments
 (0)