-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit.php
More file actions
33 lines (28 loc) · 741 Bytes
/
unit.php
File metadata and controls
33 lines (28 loc) · 741 Bytes
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
33
<?php
/**
* @author: mix
* @date: 27.10.14
*/
class Unit extends PHPUnit_Framework_TestCase
{
public function providerTest() {
$out = [];
$files = scandir(__DIR__ . "/test/source/");
array_shift($files);
array_shift($files);
foreach ($files as $file) {
$out[] = [$file];
}
return $out;
}
/**
* @param $filename
* @dataProvider providerTest
*/
public function testTest($filename) {
$f = new \PhpParser\FileLoader(__DIR__ . "/test/source/{$filename}");
$expected = include __DIR__ . "/test/result/{$filename}";
$actual = $f->getTree()->getCode()->first();
$this->assertEquals($expected, $actual);
}
}