-
Notifications
You must be signed in to change notification settings - Fork 60
/
CustomTtlTest.php
34 lines (29 loc) · 965 Bytes
/
CustomTtlTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
* This file is part of the FOSHttpCache package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\HttpCache\Tests\Functional\Varnish;
use FOS\HttpCache\Test\VarnishTestCase;
use PHPUnit\Framework\Attributes as PHPUnit;
#[PHPUnit\Group('webserver')]
#[PHPUnit\Group('varnish')]
class CustomTtlTest extends VarnishTestCase
{
protected function getConfigFile(): string
{
return match ((int) $this->getVarnishVersion()) {
3 => dirname(__DIR__).'/Fixtures/varnish-3/custom_ttl.vcl',
default => dirname(__DIR__).'/Fixtures/varnish/custom_ttl.vcl',
};
}
public function testCustomTtl(): void
{
$this->assertMiss($this->getResponse('/custom-ttl.php'));
$this->assertHit($this->getResponse('/custom-ttl.php'));
}
}