GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 75bdf9...8faa57 )
by joseph
83:56 queued 81:04
created

assertExceptionOnCreateWhenPathDoesNotExist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Small\CodeGeneration\Filesystem;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\File;
6
use EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException;
7
use PHPUnit\Framework\TestCase;
8
9
/**
10
 * @covers \EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\File
11
 * @covers \EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Filesystem\AbstractFilesystemItem
12
 */
13
class FilePathNotExistsTest extends TestCase
14
{
15
16
    /**
17
     * @test
18
     * @small
19
     */
20
    public function constructWithPathParamThatDoesNotExist(): File
21
    {
22
        $pathNotExists = '/path/not/exists';
23
        $object        = new File($pathNotExists);
24
        self::assertSame($pathNotExists, $object->getPath());
25
        self::assertFalse($object->exists());
26
        self::assertNull($object->getContents());
27
28
        return $object;
29
    }
30
31
    /**
32
     * @test
33
     * @small
34
     * @depends constructWithPathParamThatDoesNotExist
35
     *
36
     * @param File $object
37
     *
38
     * @throws DoctrineStaticMetaException
39
     */
40
    public function assertExceptionOnGetObjectWhenPathDoesNotExist(File $object): void
41
    {
42
        $this->expectException(DoctrineStaticMetaException::class);
43
        $this->expectExceptionMessage('file does not exist at path');
44
        $object->getSplFileInfo();
45
    }
46
47
    /**
48
     * @test
49
     * @small
50
     * @depends constructWithPathParamThatDoesNotExist
51
     *
52
     * @param File $object
53
     *
54
     * @throws DoctrineStaticMetaException
55
     */
56
    public function assertExceptionOnCreateWhenPathDoesNotExist(File $object): void
57
    {
58
        $this->expectException(DoctrineStaticMetaException::class);
59
        $this->expectExceptionMessage('directory does not exist at path');
60
        $object->create();
61
    }
62
63
    /**
64
     * @test
65
     * @small
66
     * @depends constructWithPathParamThatDoesNotExist
67
     *
68
     * @param File $object
69
     *
70
     * @throws DoctrineStaticMetaException
71
     */
72
    public function assertExceptionOnLoadContentsWhenPathDoesNotExist(File $object): void
73
    {
74
        $this->expectException(DoctrineStaticMetaException::class);
75
        $this->expectExceptionMessage('file does not exist at path');
76
        $object->loadContents();
77
    }
78
79
    /**
80
     * @test
81
     * @small
82
     * @depends constructWithPathParamThatDoesNotExist
83
     *
84
     * @param File $object
85
     *
86
     * @throws DoctrineStaticMetaException
87
     */
88
    public function assertExceptionOnPutContentsWhenPathDoesNotExist(File $object): void
89
    {
90
        $this->expectException(DoctrineStaticMetaException::class);
91
        $this->expectExceptionMessage('file does not exist at path');
92
        $object->putContents();
93
    }
94
95
    /**
96
     * @test
97
     * @small
98
     * @depends constructWithPathParamThatDoesNotExist
99
     *
100
     * @param File $object
101
     *
102
     * @throws DoctrineStaticMetaException
103
     */
104
    public function assertExceptionOnGetFileInfoWhenPathDoesNotExist(File $object): void
105
    {
106
        $this->expectException(DoctrineStaticMetaException::class);
107
        $this->expectExceptionMessage('file does not exist at path');
108
        $object->getSplFileInfo();
109
    }
110
111
    /**
112
     * @test
113
     * @small
114
     * @depends constructWithPathParamThatDoesNotExist
115
     *
116
     * @param File $object
117
     *
118
     * @throws DoctrineStaticMetaException
119
     */
120
    public function assertExceptionOnGetFileObjectWhenPathDoesNotExist(File $object): void
121
    {
122
        $this->expectException(DoctrineStaticMetaException::class);
123
        $this->expectExceptionMessage('file does not exist at path');
124
        $object->getSplFileObject();
125
    }
126
}
127