// Test that write doesn't break if the session is invalid
$session = $manager->getEmptySession();
$session->persist();
- session_id( $session->getId() );
+ $id = $session->getId();
+ unset( $session );
+ session_id( $id );
session_start();
$this->mergeMwGlobalArrayValue( 'wgHooks', [
'SessionCheckInfo' => [ function ( &$reason ) {
return false;
} ],
] );
- $this->assertNull( $manager->getSessionById( $session->getId(), true ), 'sanity check' );
+ $this->assertNull( $manager->getSessionById( $id, true ), 'sanity check' );
session_write_close();
+
$this->mergeMwGlobalArrayValue( 'wgHooks', [
'SessionCheckInfo' => [],
] );
- $this->assertNotNull( $manager->getSessionById( $session->getId(), true ), 'sanity check' );
+ $this->assertNotNull( $manager->getSessionById( $id, true ), 'sanity check' );
}
public static function provideHandlers() {