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

Application/Unit testing with Codeception problem. #68

Open
mpemberton5 opened this issue Sep 2, 2014 · 9 comments
Open

Application/Unit testing with Codeception problem. #68

mpemberton5 opened this issue Sep 2, 2014 · 9 comments
Labels
Milestone

Comments

@mpemberton5
Copy link

I'm trying to do the right thing by testing :) and using Codeception. But I'm getting an error stating that "Driver [verify] not supported." when attempting to do functional or unit testing.

Is there a way around this or am I stuck with doing acceptance testing? Wanted to see what others are doing.

Thanks!

@bgallagh3r
Copy link
Contributor

I get the same where whenever I run artisan tail or try to push to a queue. I'm looking into this further.

@bgallagh3r
Copy link
Contributor

I'm pretty sure this is an issue with how verify registers the auth driver, I'll look into this later tonight and see about fixing it considering I am now having the same issue.

@Toddish
Copy link
Owner

Toddish commented Sep 10, 2014

Sorry guys, getting married this weekend, so verify hasn't been a priority
the past few months!

Good luck fixing it, I'll merge anything in in the next few weeks :)
On 10 Sep 2014 19:39, "Brian Gallagher" notifications@github.com wrote:

I'm pretty sure this is an issue with how verify registers the auth
driver, I'll look into this later tonight and see about fixing it
considering I am now having the same issue.


Reply to this email directly or view it on GitHub
#68 (comment).

@bgallagh3r
Copy link
Contributor

Thanks for the heads up. If I get a fix for it I'll link to my fork for now for people who need it asap.

@bgallagh3r
Copy link
Contributor

Just a heads up from what I've been able to uncover so far it appears to be an issue in the order you load your the service providers. Because Verify is not deferred, if you fire another service provider that isn't deferred that binds to the Auth facade /driver before Toddish you'll receive this error since upon boot Laravel does an array_walk over the providers and loads the NON deferred providers in the order they are listed. Please ensure that Toddish\Verify\VerifyServiceProvider is the FIRST provider after the default laravel providers in the list and let me know if that helps at all?

@Toddish
Copy link
Owner

Toddish commented Oct 1, 2014

Hey,

Should I set the provider to be deferred then?

Would that solve this issue?

@Toddish
Copy link
Owner

Toddish commented Mar 21, 2015

Any updates on this?

It'd be nice to get a fix in for v4.

@Toddish Toddish added this to the 4.0.0 milestone Mar 21, 2015
@Toddish Toddish added the bug label Mar 21, 2015
@mpemberton5
Copy link
Author

I've confirmed the the provider is the first after the default Laravel providers but no luck. Same error. Are there any other options?

@mpemberton5
Copy link
Author

Found a way to bypass this error for now. Credit goes to a post from another auth provider forum that had the same issue. I've been able to successfully write some tests for phpunit, and soon will confirm it is working for Codeception.

Within your auth.php file where you define the driver, enter this:

'driver' => App::runningInConsole() ? 'eloquent' : 'verify',

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

3 participants