public function testPostAuthentication() { $us = new UserSession($this->container); $this->assertFalse($us->isPostAuthenticationValidated()); $this->container['sessionStorage']->postAuthenticationValidated = false; $this->assertFalse($us->isPostAuthenticationValidated()); $us->validatePostAuthentication(); $this->assertTrue($us->isPostAuthenticationValidated()); $this->container['sessionStorage']->user = array(); $this->assertFalse($us->hasPostAuthentication()); $this->container['sessionStorage']->user = array('twofactor_activated' => false); $this->assertFalse($us->hasPostAuthentication()); $this->container['sessionStorage']->user = array('twofactor_activated' => true); $this->assertTrue($us->hasPostAuthentication()); $us->disablePostAuthentication(); $this->assertFalse($us->hasPostAuthentication()); }