OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
/
Xpress
/
vendor
/
guzzlehttp
/
promises
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/26/2025 04:24:26 AM
rwxr-xr-x
📄
AggregateExceptionTest.php
456 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
CoroutineTest.php
3.63 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
CreateTest.php
1.63 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
EachPromiseTest.php
14.92 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
EachTest.php
944 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
FulfilledPromiseTest.php
3.12 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
IsTest.php
1.06 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
NotPromiseInstance.php
1.08 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
PromiseTest.php
22.44 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
PropertyHelper.php
596 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
RejectedPromiseTest.php
4.08 KB
03/26/2025 04:23:08 AM
rw-r--r--
📄
RejectionExceptionTest.php
796 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
TaskQueueTest.php
942 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
Thennable.php
502 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
Thing1.php
296 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
Thing2.php
228 bytes
03/26/2025 04:23:08 AM
rw-r--r--
📄
UtilsTest.php
24.18 KB
03/26/2025 04:23:08 AM
rw-r--r--
Editing: CreateTest.php
Close
<?php declare(strict_types=1); namespace GuzzleHttp\Promise\Tests; use GuzzleHttp\Promise as P; use GuzzleHttp\Promise\FulfilledPromise; use GuzzleHttp\Promise\Promise; use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Promise\RejectedPromise; use PHPUnit\Framework\TestCase; class CreateTest extends TestCase { public function testCreatesPromiseForValue(): void { $p = P\Create::promiseFor('foo'); $this->assertInstanceOf(FulfilledPromise::class, $p); } public function testReturnsPromiseForPromise(): void { $p = new Promise(); $this->assertSame($p, P\Create::promiseFor($p)); } public function testReturnsPromiseForThennable(): void { $p = new Thennable(); $wrapped = P\Create::promiseFor($p); $this->assertNotSame($p, $wrapped); $this->assertInstanceOf(PromiseInterface::class, $wrapped); $p->resolve('foo'); P\Utils::queue()->run(); $this->assertSame('foo', $wrapped->wait()); } public function testReturnsRejection(): void { $p = P\Create::rejectionFor('fail'); $this->assertInstanceOf(RejectedPromise::class, $p); $this->assertSame('fail', PropertyHelper::get($p, 'reason')); } public function testReturnsPromisesAsIsInRejectionFor(): void { $a = new Promise(); $b = P\Create::rejectionFor($a); $this->assertSame($a, $b); } public function testIterForReturnsIterator(): void { $iter = new \ArrayIterator(); $this->assertSame($iter, P\Create::iterFor($iter)); } }