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

[2.x] Create a user withPersonalTeam only if the teams feature is enabled #776

Closed
wants to merge 1 commit into from

Conversation

m074554n
Copy link

  • Jetstream Version: 2.3.4
  • Jetstream Stack: Inertia
  • Uses Teams: no
  • Laravel Version: 8.40.0
  • PHP Version: 7.4.16
  • Database Driver & Version: MySQL 8.0.21

Description:

After I created a fresh installation of latest Laravel version and installed Jetstream with teams disabled and other features enabled, I ran the php artisan test and I get this error:

• Tests\Feature\EmailVerificationTest > email verification screen can be rendered
   BadMethodCallException 

  Call to undefined method Database\Factories\UserFactory::withPersonalTeam()

  at vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50
     46▕      * @throws \BadMethodCallException
     47▕      */
     48▕     protected static function throwBadMethodCallException($method)
     49▕     {
  ➜  50▕         throw new BadMethodCallException(sprintf(
     51▕             'Call to undefined method %s::%s()', static::class, $method
     52▕         ));
     53▕     }
     54▕ }

      +1 vendor frames 
  2   tests/Feature/EmailVerificationTest.php:25
      Illuminate\Database\Eloquent\Factories\Factory::__call("withPersonalTeam", [])

Steps To Reproduce:

  • Install Jetstream without teams
  • Enable email verification and all Jetstream features except teams
  • run php artisan test

@driesvints driesvints changed the title Fix Test: Create a user withPersonalTeam only if the teams feature is enabled [2.x] Create a user withPersonalTeam only if the teams feature is enabled Apr 30, 2021
@taylorotwell
Copy link
Member

We should just always install the UserFactory stub instead.

@taylorotwell
Copy link
Member

Pushed a commit to do this.

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.

None yet

2 participants