Completed
Push — master ( a15c22...e7ceec )
by Jefersson
13s queued 11s
created

DirectoryExceptionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
12
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
13
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
14
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
16
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
 *
18
 * This software consists of voluntary contributions made by many individuals
19
 * and is licensed under the MIT license.
20
 */
21
namespace DocHeaderTest\Command\Exception;
22
23
use DocHeader\Command\Exception\DirectoryNotFound;
24
use PHPUnit\Framework\TestCase;
25
26
/**
27
 * Tests for {@see \DocHeader\Command\Exception\DirectoryNotFound}.
28
 *
29
 * @group   Unitary
30
 * @covers  \DocHeader\Command\Exception\DirectoryNotFound
31
 */
32
final class DirectoryExceptionTest extends TestCase
33
{
34
    /**
35
     * @test
36
     */
37
    public function it_should_throw_exception_for_directory_not_found() : void
38
    {
39
        $sut = DirectoryNotFound::withName('foo');
40
41
        $this->assertInstanceOf(DirectoryNotFound::class, $sut);
42
        $this->assertSame(
43
            'Directory "foo" could not be found.',
44
            $sut->getMessage()
45
        );
46
47
        $this->expectException(DirectoryNotFound::class);
48
49
        throw $sut;
50
    }
51
}
52