Example #1
0
 /**
  *  Test path param
  */
 public function testPathParamExistingPath()
 {
     $paramValueMap = [['workingPath', null, '/tmp']];
     $this->route->method('getMatchedParam')->will($this->returnValueMap($paramValueMap));
     $task = new WorkingPath();
     $result = $task($this->route, $this->console, $this->parameters);
     $this->assertEquals(0, $result);
     $this->assertEquals('/tmp', $this->parameters->workingPath);
 }
Example #2
0
 /**
  *  Test removeFactory param
  */
 public function testRemoveFactoryParam()
 {
     $paramValueMap = [['removeFactory', null, true]];
     $this->route->method('getMatchedParam')->will($this->returnValueMap($paramValueMap));
     $task = new Params();
     $result = $task($this->route, $this->console, $this->parameters);
     $this->assertEquals(0, $result);
     $this->assertTrue($this->parameters->paramRemoveFactory);
 }
Example #3
0
 /**
  *  Test path param
  */
 public function testPathParamExistingPath()
 {
     $paramValueMap = array(array('path', null, '/tmp'));
     $this->route->method('getMatchedParam')->will($this->returnValueMap($paramValueMap));
     $task = new ProjectPath();
     $result = $task($this->route, $this->console, $this->parameters);
     $this->assertEquals(0, $result);
     $this->assertEquals('/tmp', $this->parameters->projectPath);
     $this->assertEquals('/tmp/module', $this->parameters->projectModuleDir);
     $this->assertEquals('/tmp/config', $this->parameters->projectConfigDir);
 }