Passed
Push — master ( 1fb483...35eebd )
by Roman
04:31
created

testThrowExceptionWhenFileIsNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Dictionary\Features\PopulateStorage\Upload;
6
7
use App\Dictionary\Features\PopulateStorage\Upload\FileAssert;
8
use RuntimeException;
9
use App\Tests\Dictionary\DictionaryTestCase;
10
11
/**
12
 * @coversDefaultClass \App\Dictionary\Features\PopulateStorage\Upload\FileAssert
13
 */
14
final class FileAssertTest extends DictionaryTestCase
15
{
16
    /**
17
     * @covers ::assertFile
18
     */
19
    public function testSuccessfullyAssertFile(): void
20
    {
21
        FileAssert::assertFile(tempnam(sys_get_temp_dir(), 'test_'));
22
23
        self::assertTrue(true);
24
    }
25
26
    /**
27
     * @covers ::assertFile
28
     */
29
    public function testThrowExceptionWhenFileIsNotFound(): void
30
    {
31
        $this->expectException(RuntimeException::class);
32
33
        FileAssert::assertFile('/asf/test_file.txt');
34
    }
35
36
    /**
37
     * @covers ::assertCsvFile
38
     */
39
    public function testSuccessfullyAssertFileType(): void
40
    {
41
        FileAssert::assertCsvFile($this->createTempFile('.csv', ['test']));
42
43
        self::assertTrue(true);
44
    }
45
}
46