Skip to content

Conversation

@marvin255
Copy link
Contributor

There is a problem in compatibility of this module with Laravel 7. ExceptionHandler contract was changed. Now it using Throwable instead of Exception. So all tests with Codeception and Laravel7 are failing.

This is a small fix to make module compatible with Laravel7.

@Naktibalda
Copy link
Member

This change is incompatible with Laravel 5.

If it is the only difference and it is posible to detect version of Laravel at run time, it is possible to create 2 versions of the class - one for Laravel 5 and another for Laravel 7 and pick a suitable class at run time.
If it is impossible to make module compatible with both major versions, then a separate module for Laravel 7 must be created.

@Naktibalda Naktibalda mentioned this pull request Mar 10, 2020
@marvin255
Copy link
Contributor Author

Maybe we should create new branch and mark it with new 2.0 tag and set restriction for Laravel version in composer.json. What do you think about it?

@Naktibalda Naktibalda mentioned this pull request Mar 15, 2020
@Naktibalda
Copy link
Member

Please test #5 by setting composer constraint to "codeception/module-laravel5": "dev-laravel7"

@Naktibalda
Copy link
Member

I need at least one positive review on my pull request.

@marvin255
Copy link
Contributor Author

@Naktibalda works fine for me.

@marvin255
Copy link
Contributor Author

marvin255 commented Mar 27, 2020

So my tests step forward. Now my code:

$collection = $I->haveMultiple(Player::class, 3);
$playerToFind = $collection->random();

produces an error:

1) PlayerRepositoryCachedCest: Try find by primary
 Test  tests/functional/Components/PlayerRepositoryCachedCest.php:tryFindByPrimary
                                                                                     
  [BadMethodCallException] Call to undefined method App\Components\Player::random()  

This call is not supported now: https://github.com/laravel/framework/blob/7.x/src/Illuminate/Foundation/helpers.php#L486

@Naktibalda
Copy link
Member

Please patch makeMultiple method to check version of Laravel and ignore $name parameter if it is >=7

@Naktibalda
Copy link
Member

I merged #5, please raise a new issue and/or pull request to patch makeMultiple.

@Naktibalda Naktibalda closed this Mar 27, 2020
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

Successfully merging this pull request may close these issues.

2 participants