Completed
Push — develop ( 87e380...b48864 )
by Jaap
10s
created

testNotExistingFileThrowsException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2018 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace phpDocumentor\Reflection\File;
14
15
use PHPUnit\Framework\TestCase;
16
17
/**
18
 * @coversDefaultClass phpDocumentor\Reflection\File\LocalFile
19
 * @covers ::__construct
20
 */
21
class LocalFileTest extends TestCase
22
{
23
    /**
24
     * @covers ::getContents
25
     */
26
    public function testGetContents()
27
    {
28
        $file = new LocalFile(__FILE__);
29
        $this->assertStringEqualsFile(__FILE__, $file->getContents());
30
    }
31
32
    /**
33
     * @covers ::md5
34
     */
35
    public function testMd5()
36
    {
37
        $file = new LocalFile(__FILE__);
38
        $this->assertEquals(md5_file(__FILE__), $file->md5());
39
    }
40
41
    /**
42
     * @covers ::__construct
43
     * @expectedException \InvalidArgumentException
44
     */
45
    public function testNotExistingFileThrowsException()
46
    {
47
        new LocalFile('aa');
48
    }
49
50
    /**
51
     * @covers ::path
52
     */
53
    public function testPath()
54
    {
55
        $file = new LocalFile(__FILE__);
56
        $this->assertEquals(__FILE__, $file->path());
57
    }
58
}
59