/** * @depends testInitialState * @return null */ public function testSetPathReplace(IncludePath $path) { $paths = array('path_1', 'path_2'); $oldPath = get_include_path(); $expected = 'path_1' . PATH_SEPARATOR . 'path_2'; $result = $path->setPath($paths, 'replace'); $includePath = get_include_path(); $this->restoreIncludePath(); $this->assertEquals($result, $oldPath); $this->assertEquals($expected, $includePath); }
/** * Set the php include path based on paths in the config. A path can * be an actual string of include paths with the path seperator already * taken care of or an array of paths for which we will concatenate and * add the path * * @return KernelIntializer */ public function initIncludePath() { $path = KernelRegistry::getParam('include-path', array()); $action = KernelRegistry::getParam('include-path-action', 'replace'); if (empty($path)) { $msg = 'include path not initialized'; self::$status['kernal:include-path'] = $msg; return $this; } $include = new IncludePath(); $include->setPath($path, $action); $msg = 'include path initialized'; self::$status['kernel:include-path'] = $msg; return $this; }