This commit is contained in:
shibafu 2020-08-12 22:05:49 +09:00
parent b71b7e5cb2
commit 45fd630e1a
2 changed files with 17 additions and 0 deletions

View 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(),
];
});

View File

@ -2,6 +2,7 @@
namespace Tests\Unit\Services;
use App\ContentProvider;
use App\MetadataResolver\MetadataResolver;
use App\MetadataResolver\ResolverCircuitBreakException;
use App\MetadataResolver\UncaughtResolverException;
@ -26,6 +27,8 @@ class MetadataResolverServiceTest extends TestCase
parent::setUp();
$this->seed();
Carbon::setTestNow('2020-07-21 19:19:19');
// FIXME: 今書かれてるテストはresolveのHTTPリクエストのみを考慮しているので、ContentProviderにデータがないとリクエスト回数がずれる
factory(ContentProvider::class)->create();
}
protected function tearDown(): void