/**
  * 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);
 }
Exemplo n.º 2
0
 public static function getManifest()
 {
     // Create the file manifest
     $manifest = new \GreenCape\Manifest\FileManifest();
     // Meta data
     $manifest->setTarget('3.1')->setMethod('upgrade')->setName('files_joomla')->setAuthor('Joomla! Project')->setAuthorEmail('*****@*****.**')->setAuthorUrl('www.joomla.org')->setCopyright('2005 - 2013', 'Open Source Matters', false)->setLicense('GNU General Public License version 2 or later; see LICENSE.txt')->setVersion('3.1.1')->setCreationDate('April 2013')->setDescription('FILES_JOOMLA_XML_DESCRIPTION');
     // Installer hooks
     $manifest->setScriptFile('administrator/components/com_admin/script.php');
     // SQL files
     $update = new \GreenCape\Manifest\SchemaSection();
     $update->addFolder('mysql', 'administrator/components/com_admin/sql/updates/mysql')->addFolder('sqlsrv', 'administrator/components/com_admin/sql/updates/sqlsrv')->addFolder('sqlazure', 'administrator/components/com_admin/sql/updates/sqlazure')->addFolder('postgresql', 'administrator/components/com_admin/sql/updates/postgresql');
     $manifest->addSection('update', $update);
     // Front-end files
     $files = new \GreenCape\Manifest\FileSection();
     $files->addFolder('administrator')->addFolder('cache')->addFolder('cli')->addFolder('components')->addFolder('images')->addFolder('includes')->addFolder('language')->addFolder('layouts')->addFolder('libraries')->addFolder('logs')->addFolder('media')->addFolder('modules')->addFolder('plugins')->addFolder('templates')->addFolder('tmp')->addFile('htaccess.txt')->addFile('web.config.txt')->addFile('LICENSE.txt')->addFile('README.txt')->addFile('index.php');
     $fileset = new \GreenCape\Manifest\FilesetSection();
     $fileset->addFileset($files);
     $manifest->addSection('fileset', $fileset);
     // Extension Update Specification
     $server = new \GreenCape\Manifest\ServerSection();
     $server->addServer('collection', null, 'http://update.joomla.org/core/list.xml')->addServer('collection', null, 'http://update.joomla.org/jed/list.xml');
     $manifest->addSection('updateservers', $server);
     return $manifest;
 }