Skip to content

Commit

Permalink
Merge pull request #18 from localheinz/feature/squid-cache
Browse files Browse the repository at this point in the history
Enhancement: Add interface for Squid cache request methods
  • Loading branch information
localheinz authored Jun 28, 2019
2 parents edf51a5 + c009040 commit b757670
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Method/Vendor/SquidCache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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://wiki.squid-cache.org/FrontPage
*/
interface SquidCache
{
/**
* Safe: no
* Idempotent: ?
*
* @see https://wiki.squid-cache.org/SquidFaq/OperatingSquid#How_can_I_purge_an_object_from_my_cache.3F
* @see https://wiki.squid-cache.org/SquidFaq/OperatingSquid#How_can_I_purge_multiple_objects_from_my_cache.3F
*/
public const PURGE = 'PURGE';
}
30 changes: 30 additions & 0 deletions test/Unit/Method/Vendor/SquidCacheTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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\SquidCache;
use PHPUnit\Framework;

/**
* @internal
*
* @covers \Localheinz\Http\Method\Vendor\SquidCache
*/
final class SquidCacheTest extends Framework\TestCase
{
public function testConstants(): void
{
self::assertSame('PURGE', SquidCache::PURGE);
}
}

0 comments on commit b757670

Please sign in to comment.