Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Dec 30, 2023
1 parent e806d17 commit c07f933
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function render(Tokenizer $tokenizer, AbstractCache ...$directives): string
$tokenizer = new Tokenizer();

$directives[] = new NeverChanges();
expect(render($tokenizer, ...$directives))->toBe("public max-age=604800 immutable");

$directives[] = new MaxAge(3000);
expect(render($tokenizer, ...$directives))->toBe("public max-age=3000");
Expand All @@ -41,8 +42,11 @@ function render(Tokenizer $tokenizer, AbstractCache ...$directives): string
$directives[] = new MaxAge(200, true);
expect(render($tokenizer, ...$directives))->toBe("public max-age=300 s-maxage=200");

$directives[] = new MaxAge(0);
expect(render($tokenizer, ...$directives))->toBe("private no-store");
$directives[] = new NeverCache();
$directives[] = new NeverChanges();
$directives[] = new MaxAge(3000);
expect(render($tokenizer, ...$directives))->toBe("private no-store");
});

Expand Down

0 comments on commit c07f933

Please sign in to comment.