public function testIfThemeFilesWereInstalled()
 {
     Plugin::load('ThemeInstallerTest', ['routes' => false, 'bootstrap' => false]);
     $starter = new PluginStarter();
     $starter->load('ThemeInstallerTest');
     $themeInstaller = new ThemeInstaller();
     $themeInstaller->installTheme('ThemeInstallerTest');
     $this->assertEquals(true, file_exists(WWW_ROOT . 'theme' . DS . 'ThemeInstallerTest' . DS . 'css' . DS . 'sample.css'));
     $this->assertEquals(true, file_exists(WWW_ROOT . 'theme' . DS . 'ThemeInstallerTest' . DS . 'js' . DS . 'sample.js'));
     $this->assertEquals(true, file_exists(WWW_ROOT . 'theme' . DS . 'ThemeInstallerTest' . DS . 'packages' . DS . 'sample_package' . DS . 'sample.css'));
     $this->assertEquals(true, file_exists(WWW_ROOT . 'theme' . DS . 'ThemeInstallerTest' . DS . 'packages' . DS . 'sample_package' . DS . 'sample.js'));
 }
 public function testInstalledPluginSettingsFileWillNotBeOverrridenOnLoad()
 {
     $starter = new PluginStarter();
     $starter->load('PluginInstallerTest');
     $installedSettingsFile = new File(ROOT . DS . 'config' . DS . 'Plugins' . DS . 'PluginInstallerTest' . DS . 'settings.php');
     $defaultSettingsFile = new File(ROOT . DS . 'plugins' . DS . 'PluginInstallerTest' . DS . 'config' . DS . 'default_settings.php');
     $installedSettingsFile->write("<?php \n\t\t\treturn [\n\t\t\t\t'MyApplication.Modules.PluginInstallerTest.Settings' => \n\t\t\t\t\t['Default' => false]\n\t\t\t\t]; \n\t\t?>");
     $installedSettingsFile->close();
     $starter->load('PluginInstallerTest');
     $installedSettingsFile = new File(ROOT . DS . 'config' . DS . 'Plugins' . DS . 'PluginInstallerTest' . DS . 'settings.php');
     $this->assertEquals(strcmp($installedSettingsFile->md5(), $defaultSettingsFile->md5()) === 0, false);
     $installedSettingsFile->close();
     $defaultSettingsFile->close();
 }
Example #3
0
<?php

use AppCore\Lib\PluginStarter;
$starter = new PluginStarter();
$starter->load('VideoManager');
Example #4
0
<?php

use AppCore\Lib\PluginStarter;
use Cake\Cache\Cache;
$starter = new PluginStarter();
$starter->load('PhotoGallery');
Cache::config('photo_gallery_cache', ['className' => 'Cake\\Cache\\Engine\\FileEngine', 'duration' => '+1 week', 'probability' => 100, 'path' => CACHE . 'plugins' . DS . 'photo_gallery' . DS]);