set() public method

public set ( string $name, boolean | integer | string | array $value )
$name string
$value boolean | integer | string | array
Exemplo n.º 1
0
 protected function setUp()
 {
     $this->console = new Application();
     $this->_input = $this->getMock('Symfony\\Component\\Console\\Input\\InputInterface');
     $this->_output = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface');
     $this->_server = $this->getMockBuilder('Deployer\\Server\\ServerInterface')->disableOriginalConstructor()->getMock();
     $this->_env = new Environment();
     $this->_env->set("local_path", __DIR__ . '/../fixture/app');
     $this->_env->set("remote_path", "/home/www");
     $this->deployer = new Deployer($this->console, $this->_input, $this->_output);
     Context::push(new Context($this->_server, $this->_env, $this->_input, $this->_output));
 }
Exemplo n.º 2
0
 public function testByStageName()
 {
     $servers = new ServerCollection();
     $servers['one'] = new \stdClass();
     $environments = new EnvironmentCollection();
     $environments['one'] = $env = new Environment();
     $env->set('stages', ['prod']);
     $stage = new StageStrategy($servers, $environments);
     $this->assertEquals(['one' => $servers['one']], $stage->getServers('prod'));
 }
Exemplo n.º 3
0
 /**
  * Indicate stage
  *
  * @param string|array $stages  Name or array on server stages.
  *
  * @return Builder
  */
 public function stage($stages)
 {
     $this->env->set('stages', (array) $stages);
     return $this;
 }