/** * @throws Exception_IllegalState */ public function run() { if (null !== $this->configuration) { include_once $this->configuration; } if (null !== $this->m_buildPath && @is_dir($this->m_buildPath)) { $this->m_buildPath = realpath($this->m_buildPath); } if (!Io::directoryCreate($this->m_buildPath)) { throw new Exception_IllegalState('test/runner', 'Missing/invalid build path parameter.'); } $this->m_buildPath = realpath($this->m_buildPath); if (null !== $this->m_testRootPath) { $this->m_testRootPath = realpath($this->m_testRootPath); } if (!Io::directoryCreate($this->m_testRootPath)) { throw new Exception_IllegalState('test/runner', 'Missing/invalid test root path.'); } if (null === $this->output) { $this->output = new Test_Output_Null(); } if (null === $this->m_result) { $this->m_result = new Test_Result(); } $this->invokeListeners(Test_Listener::INITIALIZATION); $this->initialize(); $this->discoverTests($this->m_testRootPath); $tmp = $this->getTempPath(); $tmp->create(); $this->invokeListeners(Test_Listener::EXECUTION); $this->execute(); $this->invokeResultHandler($this->m_result); $this->invokeListeners(Test_Listener::TERMINATION); $tmp->delete(true); }
/** * @param boolean $recursive_ * @param integer $umask_ * * @return \Components\Io_Path * * @throws \Components\Io_Exception */ public function create($umask_ = 0775) { return Io::directoryCreate($this->m_path, $umask_); }
protected function createReportPath() { if (false === Io::directoryCreate($this->m_reportPath)) { throw new Exception_IllegalArgument('test/unit/result/handler', sprintf('Unable to create report path [path: %1$s].', $this->m_reportPath)); } return $this->m_reportPath; }
/** * @see \Components\Io_Image_Engine::save() \Components\Io_Image_Engine::save() * * @return \Components\Io_Image_Engine_Gd */ public function save($path_, Io_Mimetype $type_ = null) { if (null === $type_) { $type_ = Io_Mimetype::forFileExtension(Io::fileExtension($path_)); } if (null === $type_) { $type_ = Io_Mimetype::IMAGE_PNG(); } $typeName = $type_->name(); if (false === isset(self::$m_saveHandler[$typeName])) { throw new Exception_NotSupported('io/image/engine/gd', sprintf('Saving to image of requested type is not supported [%s].', $type_)); } $directory = dirname($path_); if (false === is_dir($directory)) { Io::directoryCreate($directory); } $saveHandler = self::$m_saveHandler[$typeName]; $saveHandler($this->m_resource, $path_); return $this; }