예제 #1
0
<?php

require_once dirname(__FILE__) . '/../bootstrap/unit.php';
$mode = '644';
$folder = nbConfig::get('nb_sandbox_dir') . '/folder';
$fs = nbFileSystem::getInstance();
if (php_uname('s') == 'Linux') {
    $fs->mkdir($folder);
    $t = new lime_test(1);
    $cmd = new nbChangeModeCommand();
    $commandLine = sprintf('%s %s', $folder, $mode);
    $t->ok($cmd->run(new nbCommandLineParser(), $commandLine), 'Folder mode changed successfully');
    $fs->rmdir($folder);
} else {
    $t = new lime_test(0);
    $t->comment('No tests under Windows');
}
예제 #2
0
파일: unit.php 프로젝트: nubee/bee
<?php

require_once dirname(__FILE__) . '/../../../../test/bootstrap/unit.php';
//$configParser->parseFile(dirname(__FILE__) . '/../data/config/symfony2-plugin.yml', '', true);
$configParser->parseFile(dirname(__FILE__) . '/../data/config/symfony2-deploy.yml', '', true);
$serviceContainer->pluginLoader->loadPlugins(array('nbSymfony2Plugin', 'nbArchivePlugin', 'nbMysqlPlugin', 'nbFileSystemPlugin'));
$fileSystem = nbFileSystem::getInstance();
$symfonyRootDir = nbConfig::get('symfony_project-deploy_symfony-root-dir');
$symfonyExePath = nbConfig::get('symfony_project-deploy_symfony-exe-path');
$application = nbConfig::get('test_application');
$environment = nbConfig::get('test_environment');
예제 #3
0
    $t->pass('Command requires 1 argument');
}
$t->comment(' 2. bee:install installs correctly on ' . $installDir);
$cmd->run(new nbCommandLineParser(), $installDir . ' -s ' . nbConfig::get('nb_bee_dir') . '/');
$t->ok(file_exists($installDir . '/config'), 'Command created config directory in installation folder');
$t->ok(file_exists($installDir . '/data'), 'Command created data directory in installation folder');
$t->ok(file_exists($installDir . '/docs'), 'Command created docs directory in installation folder');
$t->ok(file_exists($installDir . '/lib'), 'Command created lib directory in installation folder');
$t->ok(file_exists($installDir . '/plugins'), 'Command created plugin directory in installation folder');
$t->ok(file_exists($installDir . '/test'), 'Command created test directory in installation folder');
$t->ok(file_exists($installDir . '/bee'), 'Command created bee file in installation folder');
/*
if (PHP_OS == "Linux") {
  $t->ok(file_exists('/usr/bin/bee'), 'Command create symbolic link bee /usr/bin');
}
else if (PHP_OS == "WINNT") {

  $t->pass( "TODO: check symbolic link");
}
*/
/*
if (PHP_OS == "Linux") {
  $shell->execute( 'rm -rf '.$installDir);
  //$shell->execute( 'rm  /usr/bin/bee');
}
else if (PHP_OS == "WINNT") {
  $shell->execute( 'rd /S /Q '.$installDir);
}*/
// Tear down
nbFileSystem::getInstance()->rmdir($installDir, true);
$t->ok(!file_exists($installDir), 'Installation folder removed successfully');
예제 #4
0
require_once dirname(__FILE__) . '/../../../bootstrap/unit.php';
nbConfig::set('nb_command_dir', nbConfig::get('nb_sandbox_dir') . '/command');
nbConfig::set('nb_plugins_dir', nbConfig::get('nb_sandbox_dir') . '/plugins');
$commandDir = nbConfig::get('nb_command_dir');
$pluginsDir = nbConfig::get('nb_plugins_dir');
$t = new lime_test(7);
//Setup
nbFileSystem::getInstance()->mkdir($commandDir);
nbFileSystem::getInstance()->mkdir($pluginsDir . '/myPlugin/command', true);
nbFileSystem::getInstance()->mkdir($commandDir . '/customFolder');
$cmd = new nbGenerateCommandCommand();
$cmd->run(new nbCommandLineParser(), 'ns:cmd className');
$t->ok(file_exists($commandDir . '/ns/className.php'), 'Command create new CommandFile in command folder');
$cmd->run(new nbCommandLineParser(), '--force ns:cmd className');
$t->ok(file_exists($commandDir . '/ns/className.php'), 'Command can overwrite a file');
$cmd->run(new nbCommandLineParser(), 'ns2:cmd className');
$t->ok(file_exists($commandDir . '/ns2/className.php'), 'Command create new CommandFile in command folder');
$cmd->run(new nbCommandLineParser(), 'cmd className');
$t->ok(file_exists($commandDir . '/className.php'), 'Command can create default (non namespace) commands');
$cmd->run(new nbCommandLineParser(), '-f :cmd className');
$t->ok(file_exists($commandDir . '/className.php'), 'Command can create default (non namespace) commands');
$cmd->run(new nbCommandLineParser(), '--directory=' . $commandDir . '/customFolder :cmd className');
$t->ok(file_exists($commandDir . '/customFolder/className.php'), 'Command accept --directory option');
// plugin command
$cmd->run(new nbCommandLineParser(), '--plugin=myPlugin myPluginNs:cmd className');
$t->ok(file_exists($pluginsDir . '/myPlugin/command/myPluginNs/className.php'), 'Command accept --plugin option');
// Tear down
nbFileSystem::getInstance()->rmdir($commandDir, true);
nbFileSystem::getInstance()->rmdir($pluginsDir, true);
예제 #5
0
파일: nbCommand.php 프로젝트: nubee/bee
 /**
  * @return nbFileSystem
  */
 public function getFileSystem()
 {
     return nbFileSystem::getInstance();
 }