Skip to content

Commit daebdc6

Browse files
committed
fix: Test problems
1 parent 8f762aa commit daebdc6

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

tests/Pest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
use ElipZis\Cacheable\Tests\TestCase;
4+
5+
uses(TestCase::class)->in(__DIR__);

tests/TestCase.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace ElipZis\Cacheable\Tests;
4+
5+
use ElipZis\Cacheable\CacheableServiceProvider;
6+
use Illuminate\Database\Eloquent\Factories\Factory;
7+
use Orchestra\Testbench\TestCase as Orchestra;
8+
9+
class TestCase extends Orchestra
10+
{
11+
protected function setUp(): void
12+
{
13+
parent::setUp();
14+
15+
Factory::guessFactoryNamesUsing(
16+
fn (string $modelName) => 'ElipZis\\Cacheable\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
17+
);
18+
}
19+
20+
protected function getPackageProviders($app)
21+
{
22+
return [
23+
CacheableServiceProvider::class,
24+
];
25+
}
26+
27+
public function getEnvironmentSetUp($app)
28+
{
29+
config()->set('database.default', 'testing');
30+
}
31+
32+
public function refreshServiceProvider(): void
33+
{
34+
(new CacheableServiceProvider($this->app))->packageBooted();
35+
}
36+
}

0 commit comments

Comments
 (0)