docker-compose-viz/spec/fetch-networks.php

24 lines
766 B
PHP
Raw Normal View History

2016-08-05 15:10:28 +02:00
<?php
use function PMSIpilot\DockerComposeViz\fetchNetworks;
2016-08-05 20:51:29 +02:00
require_once __DIR__.'/../vendor/autoload.php';
2016-08-05 15:10:28 +02:00
2016-08-05 20:51:29 +02:00
describe('Fetching networks', function () {
describe('from a version 1 configuration', function () {
it('should always return an empty array', function () {
2016-08-05 15:10:28 +02:00
$configuration = ['networks' => ['image' => 'bar']];
expect(fetchNetworks($configuration))->toBe([]);
});
});
2016-08-05 20:51:29 +02:00
describe('from a version 2 configuration', function () {
it('should fetch networks from the dedicated section', function () {
2016-08-05 15:10:28 +02:00
$configuration = ['version' => 2, 'networks' => ['foo' => [], 'bar' => []]];
expect(fetchNetworks($configuration))->toBe($configuration['networks']);
});
});
});