Replies: 1 comment
-
Did you try adding on TestCase class /**
* @param \Illuminate\Foundation\Application $app
* @return array
*/
protected function getPackageProviders($app)
{
return [
\OwenIt\Auditing\AuditingServiceProvider::class,
];
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When testing with
pest
, Pest does not boot the Laravel application. So we may get the error if we use Auditable on our model. Like:Test.php
Post.php
Run test
Result:
It should be pass the booting app.
it goes the bootAuditable.
then
In
isAuditingEnabled
functionApp::runningInConsole()
is failing when using non-boot tools. BecauseApp
is not loaded yet. AlsoConfig
will not be able to load.Probably there is not perfect way to fix this. For testing purposes manually I added return true/false; in here.
Beta Was this translation helpful? Give feedback.
All reactions