public function testSerialize() { $c = new Horde_Imap_Client_Data_Capability_Imap(); $c->add('FOO', 'A'); $c->add('FOO', 'B'); $c->add('BAR'); $c->enable('BAR'); $mock = $this->getMock('SplObserver'); $mock->expects($this->never())->method('update')->with($this->equalTo($c)); $c->attach($mock); $c_copy = unserialize(serialize($c)); $this->assertTrue($c_copy->query('FOO', 'A')); $this->assertTrue($c_copy->query('FOO', 'B')); $this->assertTrue($c_copy->query('BAR')); $this->assertFalse($c_copy->isEnabled('BAR')); $c_copy->add('BAZ'); }