-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StorageFailure and FileNotFound exceptions for Flysystem adapter #519
Conversation
{ | ||
$adapter->read('filename')->willThrow(new FileNotFoundException('filename')); | ||
|
||
$this->shouldThrow('Gaufrette\Exception\FileNotFound')->duringread('filename'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the lower "r" a mistake or is it due to the pretty old version of phpspec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks surprising but yes, it's because of an old version of phpspec (2.4). BTW I ran into issues when trying to run the phpspec tests : the phpspec.yml
file has a dependency on Akeneo\SkipExampleExtension
but I couldn't get it installed via composer (unresolvable set of packages). So I had to comment that file to run the tests on my machine 😕 . I'm still wondering how the tests can be executed on the CI .
It would be a good point to bump up the tests tools to their latest version 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into issues when trying to run the phpspec tests : the phpspec.yml file has a dependency on Akeneo\SkipExampleExtension but I couldn't get it installed via composer (unresolvable set of packages). So I had to comment that file to run the tests on my machine 😕
Mh, that's strange! The akeneo/phpspec-skip-example-extension
package is in our composer.json for some time now. Was there any error message/stacktrace?
It would be a good point to bump up the tests tools to their latest version 😉
Yep, I already upgraded phpunit to 5.7 and there's a task about upgrading phpspec in the github project ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no error during composer install
, but the akeneo directory was not present in the vendor
. However, when trying to manually install the package, I got the following error :
$ composer require --dev akeneo/phpspec-skip-example-extension
Using version ^3.0@dev for akeneo/phpspec-skip-example-extension
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- akeneo/phpspec-skip-example-extension 3.0.x-dev requires phpspec/phpspec ^4.0 -> satisfiable by phpspec/phpspec[4.0.x-dev].
- akeneo/phpspec-skip-example-extension v3.0.0-alpha1 requires phpspec/phpspec ^4.0 -> satisfiable by phpspec/phpspec[4.0.x-dev].
- Conclusion: don't install phpspec/phpspec 4.0.x-dev
- Installation request for akeneo/phpspec-skip-example-extension ^3.0@dev -> satisfiable by akeneo/phpspec-skip-example-extension[3.0.x-dev, v3.0.0-alpha1].
Installation failed, reverting ./composer.json to its original content.
I haven't noticed the phpspec upgrade card, I'll try to give it a look 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you try to delete your local composer.lock
first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shame on me 🔨 removing the composer.lock
file and running composer install
again did the trick :) Thank you 👍
throw StorageFailure::unexpectedFailure('read', ['key' => $key], $e); | ||
} | ||
|
||
if (false === $result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So Flysystem adapters are less stricter than us? Funny :)
Great job! Thank you :) |
Related to #497 .
To be complient with the new Adapter implementation, the adapter throws a
StorageFailure
exeption instead of returningfalse
if the original adapter returnsfalse
in case of failure.