generated from ergebnis/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from localheinz/feature/varnish-cache
Enhancement: Add interface for Varnish cache request methods
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2019 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @see https://github.com/localheinz/http-method | ||
*/ | ||
|
||
namespace Localheinz\Http\Method\Vendor; | ||
|
||
/** | ||
* @see https://varnish-cache.org/docs/index.html | ||
*/ | ||
interface VarnishCache | ||
{ | ||
/** | ||
* Safe: ? | ||
* Idempotent: ? | ||
* | ||
* @see https://varnish-cache.org/docs/3.0/tutorial/purging.html#bans | ||
*/ | ||
public const BAN = 'BAN'; | ||
|
||
/** | ||
* Safe: no | ||
* Idempotent: ? | ||
* | ||
* @see https://varnish-cache.org/docs/3.0/tutorial/purging.html#http-purges | ||
*/ | ||
public const PURGE = 'PURGE'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2019 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @see https://github.com/localheinz/http-method | ||
*/ | ||
|
||
namespace Localheinz\Http\Test\Unit\Method\Vendor; | ||
|
||
use Localheinz\Http\Method\Vendor\VarnishCache; | ||
use PHPUnit\Framework; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @covers \Localheinz\Http\Method\Vendor\VarnishCache | ||
*/ | ||
final class VarnishCacheTest extends Framework\TestCase | ||
{ | ||
public function testConstants(): void | ||
{ | ||
self::assertSame('BAN', VarnishCache::BAN); | ||
self::assertSame('PURGE', VarnishCache::PURGE); | ||
} | ||
} |