Completed
Push — develope ( 31b18b...6fd8e0 )
by Anatoliy
02:01
created

PidFileTestCase::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: danchukas
5
 * Date: 2017-07-17 21:51
6
 */
7
8
namespace DanchukAS\DenyMultiplyRun;
9
10
use PHPUnit\Framework\TestCase;
11
12
/**
13
 * Class PidFileTestCase
14
 * included shared test settings.
15
 * @package DanchukAS\DenyMultiplyRun
16
 */
17
abstract class PidFileTestCase extends TestCase
18
{
19
    protected static $noExistFileName;
20
21
    protected static $existFileName;
22
23
24
    public function setUp()
25
    {
26
        self::$noExistFileName = sys_get_temp_dir() . '/' . uniqid('vd_', true);
27
        self::$existFileName = tempnam(sys_get_temp_dir(), 'vo_');
28
    }
29
30
    public function tearDown()
31
    {
32
        /** @noinspection PhpUsageOfSilenceOperatorInspection */
33
        @unlink(self::$noExistFileName);
34
        /** @noinspection PhpUsageOfSilenceOperatorInspection */
35
        @unlink(self::$existFileName);
36
    }
37
}