public function testRemoval() { $c = new Horde_Imap_Client_Data_Capability(); $c->add('FOO'); $this->assertTrue($c->query('FOO')); $c->remove('FOO'); $this->assertFalse($c->query('FOO')); $c->add('BAR', array('A', 'B', 'C')); $c->remove('BAR', array('A', 'C')); $this->assertTrue($c->query('BAR')); $this->assertFalse($c->query('BAR', 'A')); $this->assertTrue($c->query('BAR', 'B')); $this->assertFalse($c->query('BAR', 'C')); $c->remove('BAR', 'b'); $this->assertFalse($c->query('BAR')); $this->assertFalse($c->query('BAR', 'A')); $this->assertFalse($c->query('BAR', 'B')); $this->assertFalse($c->query('BAR', 'C')); }
/** */ public function query($capability, $parameter = null) { if (parent::query($capability, $parameter)) { return true; } switch (Horde_String::upper($capability)) { case 'CONDSTORE': case 'ENABLE': /* RFC 7162 [3.2.3] - QRESYNC implies CONDSTORE and ENABLE. */ return is_null($parameter) && $this->query('QRESYNC'); case 'UTF8': /* RFC 6855 [3] - UTF8=ONLY implies UTF8=ACCEPT. */ return Horde_String::upper($parameter) === 'ACCEPT' && $this->query('UTF8', 'ONLY'); } return false; }