diff --git a/src/WoolTrait.php b/src/WoolTrait.php index e80d1654..497a7e38 100644 --- a/src/WoolTrait.php +++ b/src/WoolTrait.php @@ -98,7 +98,7 @@ public function stat(array $payload) { if (!file_exists($payload['path'])) { return \React\Promise\reject([ - 'error' => 'Path doesn\'t exist', + 'error' => ['message' => 'Path doesn\'t exist'], ]); } diff --git a/tests/Adapters/FileTest.php b/tests/Adapters/FileTest.php index 55cf9bce..863677c7 100644 --- a/tests/Adapters/FileTest.php +++ b/tests/Adapters/FileTest.php @@ -79,16 +79,18 @@ public function testExists(LoopInterface $loop, FilesystemInterface $filesystem) /** * @dataProvider filesystemProvider */ - public function testDoesntExists(LoopInterface $loop, FilesystemInterface $filesystem) + public function testDoesntExist(LoopInterface $loop, FilesystemInterface $filesystem) { $this->setLoopTimeout($loop); - $result = false; + $rejectionReason = null; + try { - $this->await($filesystem->file(__FILE__ . '.' . time())->exists(), $loop); + $this->await($filesystem->file(__FILE__ . '.' . time())->stat(), $loop); } catch (\Exception $e) { - $result = true; + $rejectionReason = $e->getMessage(); } - $this->assertTrue($result); + + $this->assertEquals("Path doesn't exist", $rejectionReason); } /**