/** * Test we get a proper exception when an invalid return constant is passed * */ public function testExceptGetCookieInvalidReturnType() { $cookie = HTTP\Cookie::fromString('foo=bar; domain=example.com;'); $jar = new HTTP\CookieJar(); $jar->addCookie($cookie); try { $jar->getCookie('http://example.com/', 'foo', 5); $this->fail('Expected getCookie to throw exception, invalid return type'); } catch (HTTP\Exception $e) { // We are ok! } }