/** * @test */ public function hasKeyReturnsTrueOrFalseAccordingToAvailableKeys() { $session = new Session\TransientSession(); $session->start(); $session->putData('theKey', 'some data'); $this->assertTrue($session->hasKey('theKey')); $this->assertFalse($session->hasKey('noKey')); }
/** * Proofs correct logging behaviour without argument reason given * * @test */ public function logDestroyDoesNotRequireArgumentReason() { $testSession = new TransientSession(); $testSession->start(); $testSessionId = $testSession->getId(); $mockJoinPoint = new JoinPoint($testSession, TransientSession::class, 'destroy', []); $mockSystemLogger = $this->createMock(SystemLoggerInterface::class); $mockSystemLogger->expects($this->once())->method('log')->with($this->equalTo('TransientSession: Destroyed session with id ' . $testSessionId . ': no reason given')); $loggingAspect = new LoggingAspect(); $this->inject($loggingAspect, 'systemLogger', $mockSystemLogger); $loggingAspect->logDestroy($mockJoinPoint); }