Skip to content

Commit

Permalink
Updated InteractsWithModelFactory to handle missing dependencies (#6731)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia authored May 7, 2024
1 parent 465cbb4 commit 923e862
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Concerns/InteractsWithModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace Hyperf\Testing\Concerns;

use Faker\Factory as FakerFactory;
use Hyperf\Database\Model\Factory;
use Hyperf\Testing\ModelFactory;

trait InteractsWithModelFactory
Expand All @@ -26,7 +27,7 @@ trait InteractsWithModelFactory

protected function setUpInteractsWithModelFactory()
{
if (! class_exists(FakerFactory::class)) {
if (! class_exists(Factory::class) || ! class_exists(FakerFactory::class)) {
return;
}

Expand Down

0 comments on commit 923e862

Please sign in to comment.