Skip to content

Commit

Permalink
all datatypes for blackhole adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesper Beisner committed Sep 17, 2020
1 parent 256bad4 commit c09b0ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/BlackHole.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,19 @@ public function getCapabilities()
if ($this->capabilities === null) {
// use default capabilities only
$this->capabilityMarker = new stdClass();
$this->capabilities = new Capabilities($this, $this->capabilityMarker);
$this->capabilities = new Capabilities($this, $this->capabilityMarker, [
'supportedDatatypes' => [
'NULL' => true,
'boolean' => true,
'integer' => true,
'double' => true,
'string' => true,
'array' => true,
'object' => true,
'resource' => true,
'light' => true
],
]);
}
return $this->capabilities;
}
Expand Down
10 changes: 10 additions & 0 deletions test/unit/BlackHoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,14 @@ public function testTotalSpaceCapableInterface()
$this->assertInstanceOf('Laminas\Cache\Storage\TotalSpaceCapableInterface', $this->storage);
$this->assertSame(0, $this->storage->getTotalSpace());
}

public function testSupportedDataTypes()
{
$capabilities = $this->storage->getCapabilities();
$supportedDataTypes = $capabilities->getSupportedDatatypes();
$this->assertNotEmpty($supportedDataTypes);
foreach ($supportedDataTypes as $supportedDataType) {
$this->assertTrue($supportedDataType);
}
}
}

0 comments on commit c09b0ba

Please sign in to comment.