diff --git a/spec/Gaufrette/Adapter/FlysystemSpec.php b/spec/Gaufrette/Adapter/FlysystemSpec.php index cefc46ef4..2fbfbba43 100644 --- a/spec/Gaufrette/Adapter/FlysystemSpec.php +++ b/spec/Gaufrette/Adapter/FlysystemSpec.php @@ -45,6 +45,13 @@ function it_checks_if_file_exists(AdapterInterface $adapter) $this->exists('filename')->shouldReturn(true); } + function it_checks_if_file_exists_when_flysystem_returns_array(AdapterInterface $adapter) + { + $adapter->has('filename')->willReturn(['type' => 'file']); + + $this->exists('filename')->shouldReturn(true); + } + function it_fetches_keys(AdapterInterface $adapter) { $adapter->listContents()->willReturn([[ diff --git a/src/Gaufrette/Adapter/Flysystem.php b/src/Gaufrette/Adapter/Flysystem.php index 0e1c6dead..9e1842e7f 100644 --- a/src/Gaufrette/Adapter/Flysystem.php +++ b/src/Gaufrette/Adapter/Flysystem.php @@ -50,7 +50,7 @@ public function write($key, $content) */ public function exists($key) { - return $this->adapter->has($key); + return (bool) $this->adapter->has($key); } /**