mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
added more tests and improved api docs
This commit is contained in:
parent
9932f69cd2
commit
5e55dd7887
@ -204,7 +204,8 @@ class AnimeController extends Controller
|
||||
* @OA\Property(
|
||||
* property="url",
|
||||
* type="string",
|
||||
* description="MyAnimeList URL"
|
||||
* description="MyAnimeList URL. This is the URL of the episode's video. If there is no video url, this will be null."
|
||||
* nullable=true
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="title",
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Support\CachedData;
|
||||
use App\Support\CacheOptions;
|
||||
use Illuminate\Support\Carbon;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use Tests\TestCase;
|
||||
@ -78,4 +79,11 @@ final class CachedDataTest extends TestCase
|
||||
$sut = CachedData::from(collect());
|
||||
$this->assertEquals(true, $sut->isExpired());
|
||||
}
|
||||
|
||||
public function testIsExpiredReturnsTrueIfLastModifiedIsMoreThanCacheTtlAgo()
|
||||
{
|
||||
$this->app->get(CacheOptions::class)->setTtl(99);
|
||||
$sut = CachedData::from(collect(["modifiedAt" => Carbon::now()->subSeconds(100)]));
|
||||
$this->assertEquals(true, $sut->isExpired());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user