/** * @covers ::__construct * @covers ::setOptions * @covers ::read * @covers ::write * @covers ::clear */ public function testClear() { $session = new Session(); $session->write('key1', 'value1'); $session->write('key2', 'value2'); $session->write('key3', 'value3'); $session->clear('key1'); $this->assertArrayNotHasKey('key1', $_SESSION); $this->assertArrayHasKey('key2', $_SESSION); $session->clear(); $this->assertEmpty($_SESSION); }