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

PidFileTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 6 1
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
}