public function testRemovesSelectively() { foreach ($this->getTestCookies() as $cookie) { $this->jar->setCookie($cookie); } // Remove foo.com cookies $this->jar->clear('foo.com'); $this->assertEquals(2, count($this->jar)); // Try again, removing no further cookies $this->jar->clear('foo.com'); $this->assertEquals(2, count($this->jar)); // Remove bar.com cookies with path of /boo $this->jar->clear('bar.com', '/boo'); $this->assertEquals(1, count($this->jar)); // Remove cookie by name $this->jar->clear(null, null, 'test'); $this->assertEquals(0, count($this->jar)); }