Skip to content

Commit

Permalink
Merge pull request #19 from localheinz/feature/varnish-cache
Browse files Browse the repository at this point in the history
Enhancement: Add interface for Varnish cache request methods
  • Loading branch information
localheinz authored Jun 28, 2019
2 parents b757670 + 52884f6 commit 439e00a
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Method/Vendor/VarnishCache.php
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';
}
31 changes: 31 additions & 0 deletions test/Unit/Method/Vendor/VarnishCacheTest.php
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);
}
}

0 comments on commit 439e00a

Please sign in to comment.