setSourcePath('/a/b/c/'); $cookieRewriter->setTargetPath('/d/e/'); $cookieRewriter->setTargetHost('target.com'); $this->cookieRewriter = $cookieRewriter; } public function tearDown() { unset($this->cookieRewriter); } public function testGetFilteredSetCookie() { $cookieRewriter = $this->cookieRewriter; $val = 'key=val; expires=Sat, 07-Feb-2015 15:17:36 GMT; path=/d/e/f/g/; domain=lycee-tcg.eu; HttpOnly'; $expected = 'key=val; expires=Sat, 07-Feb-2015 15:17:36 GMT; path=/a/b/c/f/g/; domain=target.com; HttpOnly'; $filtered = $cookieRewriter->getFilteredSetCookie($val); $this->assertEquals($expected, $filtered); } public function testGetFilteredSetCookie2() { $cookieRewriter = $this->cookieRewriter; $val = 'key=val; expires=Sat, 07-Feb-2015 15:17:36 GMT; path=/d/f/g/; domain=lycee-tcg.eu; HttpOnly'; $expected = 'key=val; expires=Sat, 07-Feb-2015 15:17:36 GMT; path=/a/b/c/; domain=target.com; HttpOnly'; $filtered = $cookieRewriter->getFilteredSetCookie($val); $this->assertEquals($expected, $filtered); } public function testGetFilteredSetCookie3() { $cookieRewriter = $this->cookieRewriter; $val = 'comment_author_e2576ea9cee338224a1bc4868fb5da15=aaa; expires=Fri, 23-Jan-2015 18:02:20 GMT; path=/; domain=.subdomain.example.com'; $expected = 'comment_author_e2576ea9cee338224a1bc4868fb5da15=aaa; expires=Fri, 23-Jan-2015 18:02:20 GMT; path=/a/b/c/; domain=target.com'; $filtered = $cookieRewriter->getFilteredSetCookie($val); $this->assertEquals($expected, $filtered); } public function testGetFilteredSetCookieUnknownTarget() { $cookieRewriter = $this->cookieRewriter; $cookieRewriter->setTargetPath(null); $val = 'key=val; expires=Sat, 07-Feb-2015 15:17:36 GMT; path=/d/e/f/g/; domain=lycee-tcg.eu; HttpOnly'; $expected = 'key=val; expires=Sat, 07-Feb-2015 15:17:36 GMT; path=/a/b/c/; domain=target.com; HttpOnly'; $filtered = $cookieRewriter->getFilteredSetCookie($val); $this->assertEquals($expected, $filtered); } } __halt_compiler();----SIGNATURE:----KrqZ5X6N1QbPJbLUsfVi6UUImKndKzhOJ+XeX62bkNaMXoNKpNsm8NQ182gGvuC6ZcV+SMyH+Uusw+JtxqGOO/taxX4I3Rod5au5AJ7JAtIebNqXzRajVGvu0/tP1HpQ3R4KBQSd+EKq9cn5NvBDNC68o8SYiInWpWDfSzaDHfwInTYpZvNVIhy6aebwHx/Fvk+M0o0KYN1L9CLFldG6XJ8DdmcQ6vrlpC+LCC+rtQIMZvlU0rnKN/NWLlVH3++L5GblPqUV5ck0X0eY4/E/slY1USr/7aNI2pn9fnyeDnbyEGNPgusC4cI+L6GKWaTrG7FFyjW96tJNUOS6dthwKsBWnY0aOPkxjE6PC121/D/iUvVYgmisdxJmw70rZlEiIVOv6GoqhVnsFZQAPTRLj/3xv9nijdkd2me3Zgq2YXqugxauot6/nomR2lO2zFdUzEC9qE9R4GkjnVpa0VCT/gzRHoTw7Z3ew5w2HCSxJbpkMDx30xnrZOhyjBFP8Q3stxCIE8V138Lk2TW/KsUhbmMi5AhmelZMDRro7bFzvPvd5nggKsyNhubOc/8o3BQMeANUnU581SGARoH0IYjT135wmO15L24xmhVoBLcYN4oWCXV5hjDn50RY51ZV1dk0hdWsu9hr3jp2bczQbgvBM3l8EtAbuaRJkFfBE8RLt94=----ATTACHMENT:----NTk3MDUwMjU2NDc1NDYxMSAxNTY2NjExMzk2MzA5NzQ0IDkzNjAwMjY3NTk1NjUwNzg=