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)); }); }
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); }
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']); }
function test_it_creates_new_containers_with_unset_image() { $container = WharfContainers::make('db'); $this->assertEquals('not_set', $container->image()->name()); }
/** @test @expectedException Exception*/ function it_should_errors_if_it_saves_an_invalid_container() { $incompleteContainer = WharfContainers::make('web')->image('nginx'); $this->project->save($incompleteContainer); }
/** @expectedException Exception */ function test_it_should_not_set_a_wharf_image_for_a_different_service() { WharfContainers::make('web')->image('wharf/mysql'); }