public function testSetAndGetAndAddInterfaces() { $code = new PhpClass(); $code->setInterfaceCollection(new InterfaceCollection(array('\\Traversable'))); $this->assertInstanceOf('\\ClassGeneration\\InterfaceCollection', $code->getInterfaceCollection()); $this->assertCount(1, $code->getInterfaceCollection()); $this->assertEquals('\\Traversable', $code->getInterfaceCollection()->current()); $code->addInterface('\\Countable'); $this->assertCount(2, $code->getInterfaceCollection()); $this->assertEquals('\\Countable', $code->getInterfaceCollection()->last()); $code->getInterfaceCollection()->removeElement('\\Countable'); $this->assertCount(1, $code->getInterfaceCollection()); $code->addInterface('\\Countable'); $this->assertEquals('\\Countable', $code->getInterfaceCollection()->last()); }