/** * Detects the operation system. * * @return void */ protected function setUp() { parent::setUp(); if (stripos(PHP_OS, 'win') === false || stristr(PHP_OS, 'darwin')) { $this->os = phpucFileUtil::OS_UNIX; } else { $this->os = phpucFileUtil::OS_WINDOWS; } }
/** * Creates a prepared {@link phpucConsoleArgs} instance and the required * /projects directory. * * @return void */ protected function setUp() { parent::setUp(); chdir(dirname(__FILE__)); $this->prepareArgv(array('example', '--project-name', 'phpUnderControl', PHPUC_TEST_DIR)); $input = new phpucConsoleInput(); $input->parse(); $this->args = $input->args; $this->createTestDirectories(array('/projects', '/apache-ant-1.7.0')); $this->createTestFile('/config.xml', '<cruisecontrol />'); }
/** * The constructor sets the build file name. * * @param string $name An optional test case name. * @param array $data An optional data array. */ public function __construct($name = null, array $data = array()) { parent::__construct($name, $data); $this->fileName = PHPUC_TEST_DIR . '/build.xml'; }
/** * The ctor sets the build file name. * * @param string $name An optional test case name. * @param array $data An optional data array. */ public function __construct($name = null, array $data = array()) { parent::__construct($name, $data); $this->fileName = PHPUC_TEST_DIR . '/build.xml'; $this->buildXML = sprintf('<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL . '<project name="%s" default="build" basedir=".">' . PHP_EOL . ' <target name="build" depends=""/>' . PHP_EOL . '</project>', $this->projectName); }
/** * Creates a prepared {@link phpucConsoleArgs} instance and the required * /projects directory. * * @return void */ protected function setUp() { parent::setUp(); chdir(dirname(__FILE__)); $this->setUpVfsStream(); }
/** * Sets the test file. * * @return void */ protected function setUp() { parent::setUp(); $this->testFile = PHPUC_TEST_DIR . '/config.xml'; }
/** * Initializes the test environment. * * @return void */ public static function init() { // Load phpUnderControl base class include_once PHPUC_SOURCE . '/PhpUnderControl.php'; include_once PHPUC_SOURCE . '/Util/Autoloader.php'; // Register autoload $autoloader = new phpucAutoloader(); spl_autoload_register(array($autoloader, 'autoload')); // Load ezcBase class if (file_exists(PHPUC_EZC_BASE)) { include_once PHPUC_EZC_BASE; spl_autoload_register(array('ezcBase', 'autoload')); } include_once dirname(__FILE__) . '/ConsoleOutputBuffer.php'; phpucConsoleOutput::set(new phpucConsoleOutputBuffer()); if (!is_dir(PHPUC_TEST_DIR)) { mkdir(PHPUC_TEST_DIR); } self::$windows = phpucFileUtil::getOS() === phpucFileUtil::OS_WINDOWS; }