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

How do I write tests with this? #121

Open
AbrahamBrookes opened this issue May 4, 2021 · 1 comment
Open

How do I write tests with this? #121

AbrahamBrookes opened this issue May 4, 2021 · 1 comment
Labels

Comments

@AbrahamBrookes
Copy link

How do I go about writing tests around this library? Is there a mock I can use for my PHPUnit tests? Is there a particular tool I should use? (cypress vs dusk vs phpunit)? If I am simulating a call to my upload endpoint how do I test what happens on first chunk as opposed to last chunk as opposed to a chunk that fails halfway through? I have had a look through the tests in this repo but it doesn't really tell me much. Any leads on how to test my app where it touches this library?

@pionl
Copy link
Owner

pionl commented Mar 21, 2022

Hi,

for the endpoint resolving there is no difference between first / last chunk. As it uses dependency injection you are able to mock FileReceiver in your APP. Depends on your code

About testing - depends what type of tests you want to do. Here I've written a codeceptjs tests that will upload the file in running docker compose and tests if the file exists (by an API).

https://github.com/pionl/laravel-chunk-upload-example

@pionl pionl added the waiting label Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants