forked from ben-xo/dir2cast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAgeDirTest.php
32 lines (26 loc) · 838 Bytes
/
AgeDirTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class AgeDirTest extends TestCase
{
public function setUp(): void
{
prepare_testing_dir();
exec('php dir2cast.php --output=out.xml --dont-uncache --ignore-dir2cast-mtime');
}
public function test_age_dir()
{
$mtime1 = filemtime('dir2cast.php');
$mtime2 = filemtime('temp');
$mtime3 = filemtime('.');
$mtime4 = filemtime('out.xml');
age_dir_by('.', 10);
$this->assertEquals($mtime1 - 10, filemtime('dir2cast.php'));
$this->assertEquals($mtime2 - 10, filemtime('temp'));
$this->assertEquals($mtime3 - 10, filemtime('.'));
$this->assertEquals($mtime4 - 10, filemtime('out.xml'));
}
public function tearDown(): void
{
chdir('..');
}
}