Completed
Push — master ( 522585...279d2c )
by Harry
04:14
created

testWhenCreateDirReturnsFalseAnExceptionIsthrown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 13
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
namespace Graze\DataFile\Test\Unit\Modify;
4
5
use Graze\DataFile\Modify\Exception\MakeDirectoryFailedException;
6
use Graze\DataFile\Modify\MakeDirectory;
7
use Graze\DataFile\Node\FileNode;
8
use Graze\DataFile\Test\TestCase;
9
use League\Flysystem\FilesystemInterface;
10
use Mockery as m;
11
12
class MakeDirectoryTest extends TestCase
13
{
14 View Code Duplication
    public function testWhenCreateDirReturnsFalseAnExceptionIsthrown()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
    {
16
        $fileSystem = m::mock(FilesystemInterface::class);
17
        $directory = new FileNode($fileSystem, 'random/path');
18
19
        $fileSystem->shouldReceive('createDir')
20
                   ->with($directory->getDirectory(), ['visibility' => 'public'])
21
                   ->andReturn(false);
22
        $this->expectException(MakedirectoryFailedException::class);
23
24
        $maker = new MakeDirectory();
25
        $maker->makeDirectory($directory);
26
    }
27
}
28