fix test
This commit is contained in:
parent
b71b7e5cb2
commit
45fd630e1a
14
database/factories/ContentProviderFactory.php
Normal file
14
database/factories/ContentProviderFactory.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||||
|
|
||||||
|
use App\ContentProvider;
|
||||||
|
use Faker\Generator as Faker;
|
||||||
|
|
||||||
|
$factory->define(ContentProvider::class, function (Faker $faker) {
|
||||||
|
return [
|
||||||
|
'host' => 'example.com',
|
||||||
|
'robots' => null,
|
||||||
|
'robots_cached_at' => now(),
|
||||||
|
];
|
||||||
|
});
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Tests\Unit\Services;
|
namespace Tests\Unit\Services;
|
||||||
|
|
||||||
|
use App\ContentProvider;
|
||||||
use App\MetadataResolver\MetadataResolver;
|
use App\MetadataResolver\MetadataResolver;
|
||||||
use App\MetadataResolver\ResolverCircuitBreakException;
|
use App\MetadataResolver\ResolverCircuitBreakException;
|
||||||
use App\MetadataResolver\UncaughtResolverException;
|
use App\MetadataResolver\UncaughtResolverException;
|
||||||
@ -26,6 +27,8 @@ class MetadataResolverServiceTest extends TestCase
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->seed();
|
$this->seed();
|
||||||
Carbon::setTestNow('2020-07-21 19:19:19');
|
Carbon::setTestNow('2020-07-21 19:19:19');
|
||||||
|
// FIXME: 今書かれてるテストはresolveのHTTPリクエストのみを考慮しているので、ContentProviderにデータがないとリクエスト回数がずれる
|
||||||
|
factory(ContentProvider::class)->create();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown(): void
|
protected function tearDown(): void
|
||||||
|
Loading…
Reference in New Issue
Block a user