Skip to content
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

Unit tests and integration tests #7

Open
judgej opened this issue Nov 25, 2019 · 1 comment
Open

Unit tests and integration tests #7

judgej opened this issue Nov 25, 2019 · 1 comment
Assignees

Comments

@judgej
Copy link
Member

judgej commented Nov 25, 2019

No description provided.

@judgej judgej self-assigned this Nov 25, 2019
@judgej judgej transferred this issue from academe/laravel-azure-file-storage-driver Nov 25, 2019
@judgej
Copy link
Member Author

judgej commented Nov 25, 2019

I tried making a start on unit tests, but ran out of time. I'm no expert on mocking the Microsoft Azure API library, and got a bit stuck.

However, there are some integration tests now that will run against a live Azure file share. They test real file creation/deletion/copying/renaming/etc against three different base directories (non, a single level base and a two-level base).

To run the tests, after a composer update, set the environment variables listed in .env.example, then run:

vendor/bin/phpunit --testsuite=flysystem-azure-live-tests

To tidy up the files and directories it creates in the testing process, run:

vendor/bin/phpunit --testsuite=flysystem-azure-live-tests --filter testClearState

Apart from the testClearState, which is run once at the start of all tests, the tests are all statefull - each sets up the filesystem for the next test. This means you cannot run other tests in isolation.

judgej added a commit that referenced this issue Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant