session = new SessionService(); $this->session->start(); } protected function tearDown(): void { $this->session->destroy(); } public function testSetGetRemoveDestroy(): void { // set value $this->session->set('foo', 'bar'); $this->assertSame('bar', $this->session->get('foo')); // remove key $this->session->remove('foo'); $this->assertNull($this->session->get('foo')); // destroy session $this->session->set('baz', 'qux'); $this->session->destroy(); $this->assertEmpty($_SESSION); } }