2016-08-05 15:10:28 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use function PMSIpilot\DockerComposeViz\fetchVolumes;
|
|
|
|
|
2016-08-05 20:40:29 +02:00
|
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
2016-08-05 15:10:28 +02:00
|
|
|
|
2016-08-05 20:40:29 +02:00
|
|
|
describe('Fetching volumes', 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 = ['volumes' => ['image' => 'bar']];
|
|
|
|
|
|
|
|
expect(fetchVolumes($configuration))->toBe([]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-08-05 20:40:29 +02:00
|
|
|
describe('from a version 2 configuration', function () {
|
|
|
|
it('should fetch volumes from the dedicated section', function () {
|
2016-08-05 15:10:28 +02:00
|
|
|
$configuration = ['version' => 2, 'volumes' => ['foo' => [], 'bar' => []]];
|
|
|
|
|
|
|
|
expect(fetchVolumes($configuration))->toBe($configuration['volumes']);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|