-
Notifications
You must be signed in to change notification settings - Fork 3
/
AdaptorConfigTest.php
56 lines (45 loc) · 1.3 KB
/
AdaptorConfigTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
declare(strict_types=1);
namespace WShafer\PSR11FlySystem\Test\Config;
use PHPUnit\Framework\TestCase;
use WShafer\PSR11FlySystem\Config\AdaptorConfig;
use WShafer\PSR11FlySystem\Exception\MissingConfigException;
class AdaptorConfigTest extends TestCase
{
/** @var AdaptorConfig */
protected $config;
protected $settings;
public function setup()
{
$this->settings = [
'type' => 'local',
'options' => [
'src' => '/tmp'
],
];
$this->config = new AdaptorConfig($this->settings);
$this->assertInstanceOf(AdaptorConfig::class, $this->config);
}
public function testConstructor()
{
}
public function testGetType()
{
$this->assertEquals($this->settings['type'], $this->config->getType());
}
public function testGetOptions()
{
$this->assertEquals($this->settings['options'], $this->config->getOptions());
}
public function testFailWithNoConfig()
{
$this->expectException(MissingConfigException::class);
new AdaptorConfig([]);
}
public function testFailWithNoType()
{
$this->expectException(MissingConfigException::class);
unset($this->settings['type']);
new AdaptorConfig($this->settings);
}
}