Merge pull request #23 from cloudflare/cacheoncookie-patch

Correct input types for (Bypass) Cache on Cookie
This commit is contained in:
Junade
2017-10-03 18:16:07 +01:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ class PageRulesActions implements Configurations
]); ]);
} }
public function setBypassCacheOnCookie(bool $value) public function setBypassCacheOnCookie(string $value)
{ {
if (preg_match('/^([a-zA-Z0-9\.=|_*-]+)$/i', $value) < 1) { if (preg_match('/^([a-zA-Z0-9\.=|_*-]+)$/i', $value) < 1) {
throw new ConfigurationsException("Invalid cookie string."); throw new ConfigurationsException("Invalid cookie string.");
@@ -76,7 +76,7 @@ class PageRulesActions implements Configurations
]); ]);
} }
public function setCacheOnCookie(bool $value) public function setCacheOnCookie(string $value)
{ {
if (preg_match('/^([a-zA-Z0-9\.=|_*-]+)$/i', $value) < 1) { if (preg_match('/^([a-zA-Z0-9\.=|_*-]+)$/i', $value) < 1) {
throw new ConfigurationsException("Invalid cookie string."); throw new ConfigurationsException("Invalid cookie string.");

View File

@@ -93,13 +93,13 @@ class DNSTest extends TestCase
$mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock();
$mock->method('put')->willReturn($response); $mock->method('put')->willReturn($response);
$details = array( $details = [
'type' => 'A', 'type' => 'A',
'name' => "example.com", 'name' => "example.com",
'content' => "1.2.3.4", 'content' => "1.2.3.4",
'ttl' => 120, 'ttl' => 120,
'proxied' => false, 'proxied' => false,
); ];
$mock->expects($this->once()) $mock->expects($this->once())
->method('put') ->method('put')