public function testAddsExtensions()
 {
     $package = new Package(static::$name);
     $package->addExtension('mod_test', static::$archive_src, 'module', 'site');
     $extensions = $package->getExtensions();
     self::assertNotEmpty($extensions);
     $count_1 = count($extensions);
     self::assertEquals(1, $count_1);
     self::assertInstanceOf('\\VikiJel\\JoomlaExtensionsPackager\\Extension', $extensions['mod_test']);
     $package->addExtensionInstance(Extension::create('plg_search_stuff', static::$archive_src, 'plugin', null, 'search'));
     $extensions = $package->getExtensions();
     $count_2 = count($extensions);
     self::assertEquals(2, $count_2);
     self::assertInstanceOf('\\VikiJel\\JoomlaExtensionsPackager\\Extension', $extensions['plg_search_stuff']);
 }
 protected function initExtensions()
 {
     if (!$this->package->hasExtensions()) {
         return;
     }
     $this->writer->startElement('files');
     foreach ($this->package->getExtensions() as $ext) {
         $this->writer->startElement('file');
         $this->writeAttributeIfValueNotEmpty('type', $ext->getType());
         $this->writeAttributeIfValueNotEmpty('id', $ext->getName());
         $this->writeAttributeIfValueNotEmpty('group', $ext->getGroup());
         $this->writeAttributeIfValueNotEmpty('client', $ext->getClient());
         $this->writer->text($ext->getFile()->getName());
         $this->writer->endElement();
     }
     $this->writer->endElement();
 }