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

Broken on Laravel 5.7 #21

Open
carbontwelve opened this issue Jan 3, 2019 · 1 comment
Open

Broken on Laravel 5.7 #21

carbontwelve opened this issue Jan 3, 2019 · 1 comment
Labels
Milestone

Comments

@carbontwelve
Copy link
Contributor

carbontwelve commented Jan 3, 2019

Having updated the environment (#22) unit tests now reliably fail with a good idea as to what the issue is. It looks like the API for Symfony\Component\HttpFoundation\File\UploadedFile::__construct() has changed.

This change happened about a year ago with this being the breaking change, see the difference:

// Old
public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false) {}

// New
public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, $test = false){}

Aside from the type hinting the new API does not accept the $size it could be that a fix is just to stop sending that to the constructor?

See UnitTest result from this build below:

PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
.EEEEEEEEFEEE                                                     13 / 13 (100%)
Time: 129 ms, Memory: 12.00MB
There were 11 errors:
1) Photogabble\LaravelRememberUploads\Tests\UploadTest::testSingleFileUpload
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:65
2) Photogabble\LaravelRememberUploads\Tests\UploadTest::testArrayFileUpload
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:131
3) Photogabble\LaravelRememberUploads\Tests\UploadTest::testFileControllerExample
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:208
4) Photogabble\LaravelRememberUploads\Tests\UploadTest::testSingleFileUploadOldRemembered
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:237
5) Photogabble\LaravelRememberUploads\Tests\UploadTest::testArrayFileUploadOldRemembered
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:283
6) Photogabble\LaravelRememberUploads\Tests\UploadTest::testHelper
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:329
7) Photogabble\LaravelRememberUploads\Tests\UploadTest::testHelperWithArray
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:361
8) Photogabble\LaravelRememberUploads\Tests\UploadTest::testSingleFileValidationPasses
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:400
9) Photogabble\LaravelRememberUploads\Tests\UploadTest::testFilesForgottenWhenValidationFails
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:482
10) Photogabble\LaravelRememberUploads\Tests\UploadTest::testClearRememberedFilesHelperFunction
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:503
11) Photogabble\LaravelRememberUploads\Tests\UploadTest::testSingleFileRegressionTest
TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\File\UploadedFile::__construct() must be of the type integer or null, string given, called in /home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php on line 575
/home/travis/build/photogabble/laravel-remember-uploads/vendor/symfony/http-foundation/File/UploadedFile.php:63
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:575
/home/travis/build/photogabble/laravel-remember-uploads/tests/UploadTest.php:550
--
There was 1 failure:
1) Photogabble\LaravelRememberUploads\Tests\UploadTest::testArrayFileValidationPasses
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'The given data failed to pass validation.'
+'The given data was invalid.'
@carbontwelve
Copy link
Contributor Author

Looks like that was a red herring, still have reports of it not working on laravel 5.7 and tests pass when testing against 5.7

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

1 participant