Example #1
0
File: MainTest.php Project: jasny/Q
 /**
  * Tests Auth->authz() with no hash
  */
 public function testAuthz_INVALID_SESSION_NoChecksum()
 {
     putenv('AUTH=' . escapeshellarg(Q\implode_assoc(";", array('uid' => 1))));
     $this->setExpectedException('Q\\Auth_SessionException', "Invalid session checksum");
     $this->Auth->authz();
     $this->assertEquals(Auth::INVALID_CHECKSUM, $this->Auth->getStatus(), 'status code');
     $this->assertNotNull($this->Auth->user(), 'user');
     $this->assertEquals(1, $this->Auth->user()->getId(), 'id');
 }