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

[5.5.6 - 5.5.7] One of the last new releases broke my tests #21257

Closed
santigarcor opened this issue Sep 19, 2017 · 8 comments
Closed

[5.5.6 - 5.5.7] One of the last new releases broke my tests #21257

santigarcor opened this issue Sep 19, 2017 · 8 comments

Comments

@santigarcor
Copy link
Contributor

  • Laravel Version: 5.5.6 - 5.5.7
  • PHP Version: 7.1

Description:

After updating from 5.5.5 to 5.5.7 some of my tests are now failing. I tried to figure out what is the problem from my side, but I didn't touch any code related to the tests that are failing now.

The strange thing is that the stack trace of the error shows a middleware that I don't use for the action I'm testing. If I revert back to 5.5.5 everything works fine.

My test look something like this:

$this->signIn($this->user)->getJson(route('users.data'))
    ->assertJsonFragment(['name' => $this->user->name]);

This is the:

Illuminate\Database\Eloquent\ModelNotFoundException: No query results for model [App\Models\User] data

/home/santiago/htdocs/dataprotection/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:329
/home/santiago/htdocs/dataprotection/app/Http/Middleware/Owns.php:31 <- This is the middleware i don't use for this action
...

And these are my routes:

Route::get('users/data', 'UsersDataController@index')->name('users.data');
Route::resource('users', 'UsersController');

Steps To Reproduce:

I really don't know how to reproduce this issue, i think it's like it's doing some kind of redirection o something like that because it's showing a middleware that i don't use for that route.

@themsaid
Copy link
Member

Rollback to 5.5.6 and try, you need to identify which release exactly broke your tests.

@santigarcor
Copy link
Contributor Author

santigarcor commented Sep 19, 2017

I can't install 5.5.6 correctly, i get this error:

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

                                                                               
  [Symfony\Component\Debug\Exception\FatalThrowableError]                      
  Type error: Too few arguments to function Illuminate\Cache\Console\ClearCom  
  mand::__construct(), 1 passed in /home/santiago/htdocs/dataprotection/vendo  
  r/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvi  
  der.php on line 217 and exactly 2 expected                                   
                                                                               

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

@Hell4Ge
Copy link

Hell4Ge commented Sep 19, 2017

I will just add that I also can't update from 5.5.4 to 5.5.5 or 5.5.6 because of package discover
PHP 7.1

"require": {
    "php": ">=7.0.0",
    "barryvdh/laravel-debugbar": "^3.0",
    "fideloper/proxy": "~3.3",
    "guzzlehttp/guzzle": "^6.3",
    "laravel/framework": "5.5.4",
    "laravel/tinker": "~1.0",
    "paquettg/php-html-parser": "^1.7"
},

@themsaid
Copy link
Member

@Hell4Ge what's with package discovery?

@Hell4Ge
Copy link

Hell4Ge commented Sep 19, 2017

@themsaid I wrote this basing on error

I think that there is something wrong with composer.json file and package discovery

@santigarcor
Copy link
Contributor Author

@themsaid i think #21258 is related to this issue.

@damiani
Copy link
Contributor

damiani commented Sep 20, 2017

I suspect #21261 fixes this issue.

@themsaid
Copy link
Member

themsaid commented Sep 20, 2017

fixed in #21261

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

4 participants