Conditions | 1 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function testCreateExitingOperator() |
||
27 | { |
||
28 | $adapterCfg = $this->createMock(FilesystemAdapterConfigurationInterface::class); |
||
29 | $adapterCfg |
||
30 | ->expects($this->once()) |
||
31 | ->method('getPublicUrl') |
||
32 | ->willReturn('http://test.com'); |
||
33 | |||
34 | $cfg = $this->createMock(FilesystemPluginConfigurationInterface::class); |
||
35 | $cfg |
||
36 | ->expects($this->once()) |
||
37 | ->method('getAdapterConfiguration') |
||
38 | ->with('test') |
||
39 | ->willReturn($adapterCfg); |
||
40 | |||
41 | $adapterFactory = $this->createMock(AdapterFactoryInterface::class); |
||
42 | $adapterFactory |
||
43 | ->expects($this->once()) |
||
44 | ->method('create') |
||
45 | ->with($adapterCfg) |
||
46 | ->willReturn($this->createMock(FilesystemAdapter::class)); |
||
47 | |||
48 | $fsFactory = new FsFactory($cfg, $adapterFactory); |
||
49 | |||
50 | $adapter = $fsFactory->create('test'); |
||
51 | $this->assertInstanceOf(FilesystemOperator::class, $adapter); |
||
52 | } |
||
54 |