mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 22:36:02 +03:00
Make tests run on php 5.4
This commit is contained in:
parent
e3a864f071
commit
8626e0b45d
@ -19,8 +19,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if(! class_exists(ReactPromise::class)) {
|
if(! class_exists('React\Promise\Promise')) {
|
||||||
$this->markTestSkipped('react/promise package must be installed to run ' . self::class);
|
$this->markTestSkipped('react/promise package must be installed to run GraphQL\Tests\Executor\Promise\ReactPromiseAdapterTest');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,8 +49,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$promise = $reactAdapter->convertThenable($reactPromise);
|
$promise = $reactAdapter->convertThenable($reactPromise);
|
||||||
|
|
||||||
$this->assertInstanceOf(Promise::class, $promise);
|
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $promise);
|
||||||
$this->assertInstanceOf(FulfilledPromise::class, $promise->adoptedPromise);
|
$this->assertInstanceOf('React\Promise\FulfilledPromise', $promise->adoptedPromise);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testThen()
|
public function testThen()
|
||||||
@ -66,8 +66,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
});
|
});
|
||||||
|
|
||||||
$this->assertSame(1, $result);
|
$this->assertSame(1, $result);
|
||||||
$this->assertInstanceOf(Promise::class, $resultPromise);
|
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $resultPromise);
|
||||||
$this->assertInstanceOf(FulfilledPromise::class, $resultPromise->adoptedPromise);
|
$this->assertInstanceOf('React\Promise\FulfilledPromise', $resultPromise->adoptedPromise);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
@ -77,8 +77,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$resolve(1);
|
$resolve(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertInstanceOf(Promise::class, $resolvedPromise);
|
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $resolvedPromise);
|
||||||
$this->assertInstanceOf(ReactPromise::class, $resolvedPromise->adoptedPromise);
|
$this->assertInstanceOf('React\Promise\Promise', $resolvedPromise->adoptedPromise);
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
@ -94,8 +94,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$reactAdapter = new ReactPromiseAdapter();
|
$reactAdapter = new ReactPromiseAdapter();
|
||||||
$fulfilledPromise = $reactAdapter->createFulfilled(1);
|
$fulfilledPromise = $reactAdapter->createFulfilled(1);
|
||||||
|
|
||||||
$this->assertInstanceOf(Promise::class, $fulfilledPromise);
|
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $fulfilledPromise);
|
||||||
$this->assertInstanceOf(FulfilledPromise::class, $fulfilledPromise->adoptedPromise);
|
$this->assertInstanceOf('React\Promise\FulfilledPromise', $fulfilledPromise->adoptedPromise);
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
@ -111,8 +111,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$reactAdapter = new ReactPromiseAdapter();
|
$reactAdapter = new ReactPromiseAdapter();
|
||||||
$rejectedPromise = $reactAdapter->createRejected(new \Exception('I am a bad promise'));
|
$rejectedPromise = $reactAdapter->createRejected(new \Exception('I am a bad promise'));
|
||||||
|
|
||||||
$this->assertInstanceOf(Promise::class, $rejectedPromise);
|
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $rejectedPromise);
|
||||||
$this->assertInstanceOf(RejectedPromise::class, $rejectedPromise->adoptedPromise);
|
$this->assertInstanceOf('React\Promise\RejectedPromise', $rejectedPromise->adoptedPromise);
|
||||||
|
|
||||||
$exception = null;
|
$exception = null;
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$exception = $error;
|
$exception = $error;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->assertInstanceOf(\Exception::class, $exception);
|
$this->assertInstanceOf('\Exception', $exception);
|
||||||
$this->assertEquals('I am a bad promise', $exception->getMessage());
|
$this->assertEquals('I am a bad promise', $exception->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,8 +131,8 @@ class ReactPromiseAdapterTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$allPromise = $reactAdapter->all($promises);
|
$allPromise = $reactAdapter->all($promises);
|
||||||
|
|
||||||
$this->assertInstanceOf(Promise::class, $allPromise);
|
$this->assertInstanceOf('GraphQL\Executor\Promise\Promise', $allPromise);
|
||||||
$this->assertInstanceOf(FulfilledPromise::class, $allPromise->adoptedPromise);
|
$this->assertInstanceOf('React\Promise\FulfilledPromise', $allPromise->adoptedPromise);
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user