@@ -65,10 +65,10 @@ private function setupEnvironment($queryParamPid = null, $queryParamJwt = null,
6565 $ _GET [PluginSession::QUERY_PARAM_JWT ] = $ queryParamJwt ;
6666
6767 if ($ clearSession ) {
68- session_write_close ();
69- session_abort ();
70- $ _SESSION = [];
71- }
68+ session_write_close ();
69+ session_abort ();
70+ $ _SESSION = [];
71+ }
7272 }
7373
7474 /**
@@ -417,15 +417,15 @@ public function testDeleteFailedCallInterface() {
417417 new $ Session ($ this ->pluginId , $ this ->publicKey , null , 0 , $ handler );
418418 }
419419
420- /**
421- * @test
422- *
423- * Test that a session is created.
424- *
425- * @covers \Staffbase\plugins\sdk\PluginSession::__construct
426- */
420+ /**
421+ * @test
422+ *
423+ * Test that a session is created.
424+ *
425+ * @covers \Staffbase\plugins\sdk\PluginSession::__construct
426+ */
427427 public function testSessionIsCreated () {
428- $ tokenData = $ this ->tokenData ;
428+ $ tokenData = $ this ->tokenData ;
429429 $ this ->setupEnvironment (null , $ this ->token , true );
430430
431431 $ mock = $ this ->getMockBuilder ($ this ->classname )
@@ -436,72 +436,72 @@ public function testSessionIsCreated() {
436436 $ constructor = $ reflectedClass ->getConstructor ();
437437
438438 $ this ->assertEquals (PHP_SESSION_NONE , session_status ());
439- $ constructor ->invoke ($ mock , $ this ->pluginId , $ this ->publicKey );
440- $ this ->assertEquals (PHP_SESSION_ACTIVE , session_status ());
439+ $ constructor ->invoke ($ mock , $ this ->pluginId , $ this ->publicKey );
440+ $ this ->assertEquals (PHP_SESSION_ACTIVE , session_status ());
441441
442- $ this ->assertEquals ($ tokenData [PluginSession::CLAIM_SESSION_ID ], session_id ());
443- }
442+ $ this ->assertEquals ($ tokenData [PluginSession::CLAIM_SESSION_ID ], session_id ());
443+ }
444444
445- public function testSessionIdCheck () {
445+ public function testSessionIdCheck () {
446446
447- $ sessionHash = 'HOjLTR6+D5YIY0/waqJQp3Bg= ' ;
448- $ sessionId = 'HOjLTR6-D5YIY0-waqJQp3Bg- ' ;
447+ $ sessionHash = 'HOjLTR6+D5YIY0/waqJQp3Bg= ' ;
448+ $ sessionId = 'HOjLTR6-D5YIY0-waqJQp3Bg- ' ;
449449
450- $ tokenData = $ this ->tokenData ;
451- $ tokenData [PluginSession::CLAIM_SESSION_ID ] = $ sessionHash ;
452- $ token = SSOTokenTest::createSignedTokenFromData ($ this ->privateKey , $ tokenData );
450+ $ tokenData = $ this ->tokenData ;
451+ $ tokenData [PluginSession::CLAIM_SESSION_ID ] = $ sessionHash ;
452+ $ token = SSOTokenTest::createSignedTokenFromData ($ this ->privateKey , $ tokenData );
453453
454- $ this ->setupEnvironment (null , $ token , true );
454+ $ this ->setupEnvironment (null , $ token , true );
455455
456- $ mock = $ this ->getMockBuilder ($ this ->classname )
457- ->disableOriginalConstructor ()
458- ->getMock ();
456+ $ mock = $ this ->getMockBuilder ($ this ->classname )
457+ ->disableOriginalConstructor ()
458+ ->getMock ();
459459
460- $ reflectedClass = new ReflectionClass ($ this ->classname );
461- $ constructor = $ reflectedClass ->getConstructor ();
460+ $ reflectedClass = new ReflectionClass ($ this ->classname );
461+ $ constructor = $ reflectedClass ->getConstructor ();
462462
463- $ this ->assertEquals (PHP_SESSION_NONE , session_status ());
464- $ constructor ->invoke ($ mock , $ this ->pluginId , $ this ->publicKey );
465- $ this ->assertEquals (PHP_SESSION_ACTIVE , session_status ());
463+ $ this ->assertEquals (PHP_SESSION_NONE , session_status ());
464+ $ constructor ->invoke ($ mock , $ this ->pluginId , $ this ->publicKey );
465+ $ this ->assertEquals (PHP_SESSION_ACTIVE , session_status ());
466466
467- $ this ->assertEquals ($ sessionId , session_id ());
468- }
467+ $ this ->assertEquals ($ sessionId , session_id ());
468+ }
469469
470- public function testDestroyOtherSession () {
470+ public function testDestroyOtherSession () {
471471
472- $ sessionHash = 'HOjLTR6+D5YIY0/waqJQp3Bg= ' ;
473- $ sessionId = 'HOjLTR6-D5YIY0-waqJQp3Bg- ' ;
472+ $ sessionHash = 'HOjLTR6+D5YIY0/waqJQp3Bg= ' ;
473+ $ sessionId = 'HOjLTR6-D5YIY0-waqJQp3Bg- ' ;
474474
475- $ tokenData = $ this ->tokenData ;
476- $ tokenData [PluginSession::CLAIM_SESSION_ID ] = $ sessionHash ;
477- $ token = SSOTokenTest::createSignedTokenFromData ($ this ->privateKey , $ tokenData );
475+ $ tokenData = $ this ->tokenData ;
476+ $ tokenData [PluginSession::CLAIM_SESSION_ID ] = $ sessionHash ;
477+ $ token = SSOTokenTest::createSignedTokenFromData ($ this ->privateKey , $ tokenData );
478478
479- // successfull remote call handler mock
480- $ handler = $ this ->getMockBuilder (SessionHandlerInterface::class)
481- ->setMethodsExcept ()
482- ->getMock ();
479+ // successfull remote call handler mock
480+ $ handler = $ this ->getMockBuilder (SessionHandlerInterface::class)
481+ ->setMethodsExcept ()
482+ ->getMock ();
483483
484- $ handler ->method ('close ' )->willReturn (true );
485- $ handler ->method ('destroy ' )->willReturn (true );
486- $ handler ->method ('open ' )->willReturn (true );
487- $ handler ->method ('write ' )->willReturn (true );
488- $ handler ->method ('read ' )->willReturn ($ sessionId );
484+ $ handler ->method ('close ' )->willReturn (true );
485+ $ handler ->method ('destroy ' )->willReturn (true );
486+ $ handler ->method ('open ' )->willReturn (true );
487+ $ handler ->method ('write ' )->willReturn (true );
488+ $ handler ->method ('read ' )->willReturn ($ sessionId );
489489
490- $ this ->setupEnvironment (null , $ token , true );
490+ $ this ->setupEnvironment (null , $ token , true );
491491
492- /** @var SessionHandlerInterface $handler */
493- new PluginSession ($ this ->pluginId , $ this ->publicKey );
492+ /** @var SessionHandlerInterface $handler */
493+ new PluginSession ($ this ->pluginId , $ this ->publicKey );
494494
495- $ this ->setupEnvironment (null , $ this ->token , false );
495+ $ this ->setupEnvironment (null , $ this ->token , false );
496496
497- /** @var PluginSession $session */
498- $ session = new PluginSession ($ this ->pluginId , $ this ->publicKey , $ handler );
497+ /** @var PluginSession $session */
498+ $ session = new PluginSession ($ this ->pluginId , $ this ->publicKey , $ handler );
499499
500- $ handler ->expects ($ this ->once ())
501- ->method ('destroy ' )
502- ->with ($ sessionId );
500+ $ handler ->expects ($ this ->once ())
501+ ->method ('destroy ' )
502+ ->with ($ sessionId );
503503
504- $ session ->destroySession ($ sessionHash );
505- }
504+ $ session ->destroySession ($ sessionHash );
505+ }
506506
507507}
0 commit comments