-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathAbstractStorageTest.php
More file actions
54 lines (42 loc) · 1.14 KB
/
Copy pathAbstractStorageTest.php
File metadata and controls
54 lines (42 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Craue\FormFlowBundle\Tests\Storage;
use Craue\FormFlowBundle\Storage\StorageInterface;
/**
* @group unit
*
* @author Christian Raue <christian.raue@gmail.com>
* @copyright 2011-2015 Christian Raue
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
abstract class AbstractStorageTest extends \PHPUnit_Framework_TestCase {
/**
* @var StorageInterface
*/
protected $storage;
/**
* {@inheritDoc}
*/
protected function setUp() {
$this->storage = $this->getStorageImplementation();
}
/**
* @return StorageInterface
*/
abstract protected function getStorageImplementation();
public function testSet() {
$this->storage->set('foo', 'bar');
$this->assertTrue($this->storage->has('foo'));
$this->assertSame('bar', $this->storage->get('foo'));
}
public function testGet() {
$this->assertNull($this->storage->get('foo'));
}
public function testHas() {
$this->assertFalse($this->storage->has('foo'));
}
public function testRemove() {
$this->assertNull($this->storage->remove('foo'));
$this->storage->set('foo', 'bar');
$this->assertSame('bar', $this->storage->remove('foo'));
}
}