Skip to content

Commit

Permalink
add tests to ensure data of all types preserved correctly
Browse files Browse the repository at this point in the history
(cherry picked from commit c5af41a)
  • Loading branch information
red-led committed May 6, 2020
1 parent 30209e9 commit adde18a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/TestStorageTrait.php
Expand Up @@ -60,6 +60,31 @@ public function test_store_with_ttl()
$this->assertNull($storage->retrieve($key));
}

public function data_store_type()
{
return [
'null' => [null],
'array' => [[]],
'false' => [false],
'int' => [1],
'zero' => [0],
'float' => [3.14],
'string' => ['test'],
'empty string' => [''],
];
}

/**
* @dataProvider data_store_type
*/
public function test_store_type($data)
{
$storage = $this->storage;

$storage->store('test', $data);
$this->assertSame($data, $storage->retrieve('test'));
}

public function test_iterator()
{
$s = $this->storage;
Expand Down

0 comments on commit adde18a

Please sign in to comment.