14 use PHPUnit\Framework\TestCase;
37 protected function setUp()
39 $this->mock = $this->getMockBuilder(
'SessionHandlerInterface')->getMock();
51 $this->mock->expects($this->once())
53 ->will($this->returnValue(
true));
55 $this->assertFalse($this->proxy->isActive());
56 $this->proxy->open(
'name',
'id');
57 $this->assertFalse($this->proxy->isActive());
62 $this->mock->expects($this->once())
64 ->will($this->returnValue(
false));
66 $this->assertFalse($this->proxy->isActive());
67 $this->proxy->open(
'name',
'id');
68 $this->assertFalse($this->proxy->isActive());
73 $this->mock->expects($this->once())
75 ->will($this->returnValue(
true));
77 $this->assertFalse($this->proxy->isActive());
78 $this->proxy->close();
79 $this->assertFalse($this->proxy->isActive());
84 $this->mock->expects($this->once())
86 ->will($this->returnValue(
false));
88 $this->assertFalse($this->proxy->isActive());
89 $this->proxy->close();
90 $this->assertFalse($this->proxy->isActive());
95 $this->mock->expects($this->once())
98 $this->proxy->read(
'id');
103 $this->mock->expects($this->once())
106 $this->proxy->write(
'id',
'data');
111 $this->mock->expects($this->once())
114 $this->proxy->destroy(
'id');
119 $this->mock->expects($this->once())
122 $this->proxy->gc(86400);