Exemple #1
0
 /**
  * Test get encrypted cookie WITHOUT deleting it
  *
  * This only tests that this method runs without error. The implementation of
  * fetching the encrypted cookie is tested separately.
  */
 public function testGetEncryptedCookieWithoutDeletingIt()
 {
     Slim_Environment::mock(array('SCRIPT_NAME' => '/foo', 'PATH_INFO' => '/bar'));
     $s = new Slim();
     $r = $s->response();
     $this->assertFalse($s->getEncryptedCookie('foo', false));
     $this->assertEquals(0, preg_match("@foo=;.*@", $r['Set-Cookie']));
 }
Exemple #2
0
 public function read($id)
 {
     return Slim::getEncryptedCookie($id);
 }
Exemple #3
0
 /**
  * Test get encrypted cookie WITHOUT deleting it
  *
  * This only tests that this method runs without error. The implementation of
  * fetching the encrypted cookie is tested separately.
  */
 public function testGetEncryptedCookieWithoutDeletingIt()
 {
     Slim_Environment::mock(array('REQUEST_METHOD' => 'GET', 'REMOTE_ADDR' => '127.0.0.1', 'SCRIPT_NAME' => '/foo', 'PATH_INFO' => '/bar', 'QUERY_STRING' => 'one=foo&two=bar', 'SERVER_NAME' => 'slimframework.com', 'SERVER_PORT' => 80, 'slim.url_scheme' => 'http', 'slim.input' => '', 'slim.errors' => @fopen('php://stderr', 'w')));
     $s = new Slim();
     $r = $s->response();
     $this->assertFalse($s->getEncryptedCookie('foo', false));
     $this->assertEquals(0, preg_match("@foo=;.*@", $r['Set-Cookie']));
 }