Completed
Push — master ( 6a6e14...e9047f )
by Julián
02:21
created

FileTest::testAccessors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Effortless maintenance management (http://juliangut.com/janitor)
4
 *
5
 * @link https://github.com/juliangut/janitor for the canonical source repository
6
 *
7
 * @license https://github.com/juliangut/janitor/blob/master/LICENSE
8
 */
9
10
namespace Janitor\Test\Watcher;
11
12
use Janitor\Watcher\File;
13
14
/**
15
 * Class FileTest
16
 */
17
class FileTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * @var File
21
     */
22
    protected $watcher;
23
24
    /**
25
     * @var string
26
     */
27
    protected static $tmpFile;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public static function setUpBeforeClass()
33
    {
34
        self::$tmpFile = sys_get_temp_dir() . '/maintenance';
35
36
        touch(self::$tmpFile);
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public static function tearDownAfterClass()
43
    {
44
        unlink(self::$tmpFile);
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function setUp()
51
    {
52
        $this->watcher = new File(self::$tmpFile);
53
    }
54
55
    public function testIsActive()
56
    {
57
        self::assertTrue($this->watcher->isActive());
58
    }
59
60
    public function testIsNotActive()
61
    {
62
        unlink(self::$tmpFile);
63
64
        self::assertFalse($this->watcher->isActive());
65
66
        touch(self::$tmpFile);
67
    }
68
}
69