added more tests and improved api docs

This commit is contained in:
pushrbx 2023-02-26 01:37:30 +00:00
parent 9932f69cd2
commit 5e55dd7887
2 changed files with 10 additions and 1 deletions

View File

@ -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",

View File

@ -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());
}
}