<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Foundation\Mix;
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
use CreatesApplication;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
// Swap out the Mix manifest implementation, so we don't need
|
|
// to run the npm commands to generate a manifest file for
|
|
// the assets in order to run tests that return views.
|
|
$this->swap(Mix::class, function () {
|
|
return '';
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Create a model factory and forget observers so events do not trigger actions.
|
|
*/
|
|
public function factoryWithoutObservers($class, $name = 'default') {
|
|
$class::flushEventListeners();
|
|
return factory($class, $name);
|
|
}
|
|
}
|