Skip to content

Commit

Permalink
maintain the authors 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIrritainer committed Jun 24, 2020
1 parent e27c5a8 commit 071d8fd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/ExtSwoolePromiseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,25 @@ public function testPromiseThrowableFailuresAreConverted(): void
});
}


/**
* Test promise all with non stringable which should be converted to a string
*
* @return void
*/
public function testPromiseNonStringableValuesAreConverted(): void
{
$promise = ExtSwoolePromise::create(function (callable $resolve, callable $reject) {
$reject(new RuntimeException(['some exceptional message']));
});

/** @var ExtSwoolePromise $promise */
$promise = ExtSwoolePromise::all([$promise]);
$promise->then(null, function ($value) {
$this->assertEquals(var_export('some exceptional message', true), $value);
});
}

/**
* Test promise all first error received is the error returned
*
Expand Down
21 changes: 21 additions & 0 deletions test/PromiseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,27 @@ public function testPromiseThrowableFailuresAreConverted(): void
$promise->wait();
}

/**
* Test promise all with non stringable which should be converted to a string
*
* @return void
*/
public function testPromiseNonStringableValuesAreConverted(): void
{
$promise = Promise::create(function (callable $resolve, callable $reject) {
$reject(new RuntimeException(['some exceptional message']));
});

/** @var Promise $promise */
$promise = Promise::all([$promise]);
$promise->then(null, function ($value) {
$this->assertEquals(var_export('some exceptional message', true), $value);
});

$promise->wait();
}


/**
* Test promise all first error received is the error returned
*
Expand Down

0 comments on commit 071d8fd

Please sign in to comment.