public function testIsValidWhenRecheckRequiredAndValidReturnsTrueAndSaveTheSession() { // Make sure any remote response is negative $date = new DateTime(); $date->add(new DateInterval('PT100M')); $resp = array(); $resp["valid"] = "true"; $resp["recheck"] = $date->format(DateTime::ISO8601); $this->httpClient->setResponseStub($resp); // Set local recheck in the past $localRecheck = new DateTime(); $localRecheck->sub(new DateInterval('PT1M')); $oldSubject = new Maestrano_Sso_Session($this->httpSession); $oldSubject->setRecheck($localRecheck); // test 1 - validity $this->assertTrue($oldSubject->isValid(false, $this->httpClient)); // Create a new subject to test session persistence $this->subject = new Maestrano_Sso_Session($this->httpSession); // test 2 - session persistence $this->assertEquals($date->format(DateTime::ISO8601), $this->subject->getRecheck()->format(DateTime::ISO8601)); }