Skip to content

Commit 8626e0b

Browse files
author
Juuso Leinonen
committed
Make tests run on php 5.4
1 parent e3a864f commit 8626e0b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/Executor/Promise/ReactPromiseAdapterTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
1919
{
2020
public function setUp()
2121
{
22-
if(! class_exists(ReactPromise::class)) {
23-
$this->markTestSkipped('react/promise package must be installed to run ' . self::class);
22+
if(! class_exists('React\Promise\Promise')) {
23+
$this->markTestSkipped('react/promise package must be installed to run GraphQL\Tests\Executor\Promise\ReactPromiseAdapterTest');
2424
}
2525
}
2626

@@ -49,8 +49,8 @@ public function testConvertsReactPromisesToGraphQlOnes()
4949

5050
$promise = $reactAdapter->convertThenable($reactPromise);
5151

52-
$this->assertInstanceOf(Promise::class, $promise);
53-
$this->assertInstanceOf(FulfilledPromise::class, $promise->adoptedPromise);
52+
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $promise);
53+
$this->assertInstanceOf('React\Promise\FulfilledPromise', $promise->adoptedPromise);
5454
}
5555

5656
public function testThen()
@@ -66,8 +66,8 @@ public function testThen()
6666
});
6767

6868
$this->assertSame(1, $result);
69-
$this->assertInstanceOf(Promise::class, $resultPromise);
70-
$this->assertInstanceOf(FulfilledPromise::class, $resultPromise->adoptedPromise);
69+
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $resultPromise);
70+
$this->assertInstanceOf('React\Promise\FulfilledPromise', $resultPromise->adoptedPromise);
7171
}
7272

7373
public function testCreate()
@@ -77,8 +77,8 @@ public function testCreate()
7777
$resolve(1);
7878
});
7979

80-
$this->assertInstanceOf(Promise::class, $resolvedPromise);
81-
$this->assertInstanceOf(ReactPromise::class, $resolvedPromise->adoptedPromise);
80+
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $resolvedPromise);
81+
$this->assertInstanceOf('React\Promise\Promise', $resolvedPromise->adoptedPromise);
8282

8383
$result = null;
8484

@@ -94,8 +94,8 @@ public function testCreateFulfilled()
9494
$reactAdapter = new ReactPromiseAdapter();
9595
$fulfilledPromise = $reactAdapter->createFulfilled(1);
9696

97-
$this->assertInstanceOf(Promise::class, $fulfilledPromise);
98-
$this->assertInstanceOf(FulfilledPromise::class, $fulfilledPromise->adoptedPromise);
97+
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $fulfilledPromise);
98+
$this->assertInstanceOf('React\Promise\FulfilledPromise', $fulfilledPromise->adoptedPromise);
9999

100100
$result = null;
101101

@@ -111,16 +111,16 @@ public function testCreateRejected()
111111
$reactAdapter = new ReactPromiseAdapter();
112112
$rejectedPromise = $reactAdapter->createRejected(new \Exception('I am a bad promise'));
113113

114-
$this->assertInstanceOf(Promise::class, $rejectedPromise);
115-
$this->assertInstanceOf(RejectedPromise::class, $rejectedPromise->adoptedPromise);
114+
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $rejectedPromise);
115+
$this->assertInstanceOf('React\Promise\RejectedPromise', $rejectedPromise->adoptedPromise);
116116

117117
$exception = null;
118118

119119
$rejectedPromise->then(null, function ($error) use (&$exception) {
120120
$exception = $error;
121121
});
122122

123-
$this->assertInstanceOf(\Exception::class, $exception);
123+
$this->assertInstanceOf('\Exception', $exception);
124124
$this->assertEquals('I am a bad promise', $exception->getMessage());
125125
}
126126

@@ -131,8 +131,8 @@ public function testAll()
131131

132132
$allPromise = $reactAdapter->all($promises);
133133

134-
$this->assertInstanceOf(Promise::class, $allPromise);
135-
$this->assertInstanceOf(FulfilledPromise::class, $allPromise->adoptedPromise);
134+
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $allPromise);
135+
$this->assertInstanceOf('React\Promise\FulfilledPromise', $allPromise->adoptedPromise);
136136

137137
$result = null;
138138

0 commit comments

Comments
 (0)