/**
  * Issue #9: File manifest: fileset is not supported
  */
 public function testAddFileset()
 {
     $this->manifest->setAuthor('Test')->setCreationDate('August 2014')->setCopyright('2014', 'Test', false);
     $section = new \GreenCape\Manifest\FilesetSection();
     $files = new \GreenCape\Manifest\FileSection();
     $files->setBase('dir')->addFile('foo.txt');
     $section->addFileset($files);
     $this->manifest->addSection('fileset', $section);
     $expected = '<?xml version="1.0" encoding="UTF-8"?>';
     $expected .= '<extension method="install" type="file" version="2.5">';
     $expected .= '<author>Test</author>';
     $expected .= '<creationDate>August 2014</creationDate>';
     $expected .= '<copyright>(C) 2014 Test. All rights reserved.</copyright>';
     $expected .= '<license>GNU General Public License version 2 or later; see LICENSE.txt</license>';
     $expected .= '<fileset>';
     $expected .= '<files folder="dir">';
     $expected .= '<file>foo.txt</file>';
     $expected .= '</files>';
     $expected .= '</fileset>';
     $expected .= '</extension>';
     $this->assertXmlStringEqualsXmlString($expected, (string) $this->manifest);
 }
 public function testTypeIsCorrect()
 {
     $this->assertEquals('package', $this->manifest->getType());
 }
Exemplo n.º 3
0
 /**
  * Set the manifest values and sections from XML
  *
  * @param Converter $xml
  *
  * @return $this This object, to provide a fluent interface
  * @throws \UnexpectedValueException on unsupported attributes
  */
 protected function set(Converter $xml)
 {
     parent::set($xml);
     return $this;
 }
Exemplo n.º 4
0
 public function testGetSection()
 {
     $manifest = \GreenCape\Manifest\Manifest::load(__DIR__ . '/../data/plg_system_alpha.xml');
     $this->assertInstanceOf('\\GreenCape\\Manifest\\FileSection', $manifest->getSection('files'));
 }
 public function testTypeIsCorrect()
 {
     $this->assertEquals('component', $this->manifest->getType());
 }
 /**
  * Issue #11: help is not supported
  */
 public function testHelpIsSupported()
 {
     /** @var \GreenCape\Manifest\ModuleManifest $xml */
     $xml = \GreenCape\Manifest\Manifest::load(__DIR__ . '/../../data/issue#11.xml');
     $expected = '<?xml version="1.0" encoding="UTF-8"?>';
     $expected .= '<extension type="module" version="1.6" method="upgrade" client="site">';
     $expected .= '<name>mod_alpha</name>';
     $expected .= '<author>John Doe</author>';
     $expected .= '<creationDate>March 2006</creationDate>';
     $expected .= '<copyright>(C) 2008 - ' . date('Y') . ' Copyright Info. All rights reserved.</copyright>';
     $expected .= '<license>License Info</license>';
     $expected .= '<description>MOD_ALPHA_XML_DESCRIPTION</description>';
     $expected .= '<help key="MOD_ALPHA_HELP_KEY" />';
     $expected .= '</extension>';
     $this->assertXmlStringEqualsXmlString($expected, (string) $xml);
     $this->assertEquals('MOD_ALPHA_HELP_KEY', $xml->getHelp());
     $xml->setHelp('CHANGED');
     $this->assertEquals('CHANGED', $xml->getHelp());
 }