Beispiel #1
0
 private function loadContainers($parsedFile, $envFile)
 {
     $this->containers = new Collection();
     collect($parsedFile)->each(function ($config, $name) use($envFile) {
         $this->containers->put($name, WharfContainers::make($name, $config, $envFile));
     });
 }
Beispiel #2
0
 function test_it_should_display_infos_on_new_containers()
 {
     $output = new BufferedOutput();
     WharfContainers::make('web')->displayTo($output);
     $infos = $output->fetch();
     $this->assertRegExp('/About\\s+web container \\(NEW\\)/', $infos);
     $this->assertRegExp('/Config\\s+ERROR/', $infos);
 }
Beispiel #3
0
 function test_it_has_a_volumes_setting_by_default()
 {
     $image = Image::make('code', 'wharf/code');
     $codeContainer = WharfContainers::make('code')->image($image);
     $containerConfig = $codeContainer->toArray();
     $this->assertArrayHasKey('volumes', $containerConfig);
     $this->assertEquals(['.:/code'], $containerConfig['volumes']);
 }
Beispiel #4
0
 function test_it_creates_new_containers_with_unset_image()
 {
     $container = WharfContainers::make('db');
     $this->assertEquals('not_set', $container->image()->name());
 }
Beispiel #5
0
 /** @test @expectedException Exception*/
 function it_should_errors_if_it_saves_an_invalid_container()
 {
     $incompleteContainer = WharfContainers::make('web')->image('nginx');
     $this->project->save($incompleteContainer);
 }
Beispiel #6
0
 /** @expectedException Exception */
 function test_it_should_not_set_a_wharf_image_for_a_different_service()
 {
     WharfContainers::make('web')->image('wharf/mysql');
 }