|
20 | 20 |
|
21 | 21 | final class EndToEndTest extends TestCase
|
22 | 22 | {
|
23 |
| - private static $TEST_REPORT_PATH_SOURCE; |
24 |
| - |
25 |
| - public static function setUpBeforeClass(): void |
26 |
| - { |
27 |
| - parent::setUpBeforeClass(); |
28 |
| - |
29 |
| - self::$TEST_REPORT_PATH_SOURCE = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML'; |
30 |
| - } |
31 |
| - |
32 | 23 | protected function tearDown(): void
|
33 | 24 | {
|
34 |
| - parent::tearDown(); |
35 |
| - |
36 | 25 | $this->removeTemporaryFiles();
|
37 | 26 | }
|
38 | 27 |
|
39 | 28 | public function testLineCoverageForBankAccountTest(): void
|
40 | 29 | {
|
41 |
| - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForBankAccount'; |
| 30 | + $expectedFilesPath = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML' . DIRECTORY_SEPARATOR . 'CoverageForBankAccount'; |
42 | 31 |
|
43 | 32 | $report = new Facade;
|
44 |
| - $report->process($this->getLineCoverageForBankAccount(), self::$TEST_TMP_PATH); |
| 33 | + $report->process($this->getLineCoverageForBankAccount(), TEST_FILES_PATH . 'tmp'); |
45 | 34 |
|
46 |
| - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); |
| 35 | + $this->assertFilesEquals($expectedFilesPath, TEST_FILES_PATH . 'tmp'); |
47 | 36 | }
|
48 | 37 |
|
49 | 38 | public function testPathCoverageForBankAccountTest(): void
|
50 | 39 | {
|
51 | 40 | $this->markTestIncomplete('This test fails after https://github.com/sebastianbergmann/php-code-coverage/pull/1037 and I have not figured out how to update it.');
|
52 | 41 |
|
53 | 42 | /** @phpstan-ignore deadCode.unreachable */
|
54 |
| - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'PathCoverageForBankAccount'; |
| 43 | + $expectedFilesPath = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML' . DIRECTORY_SEPARATOR . 'PathCoverageForBankAccount'; |
55 | 44 |
|
56 | 45 | $report = new Facade;
|
57 |
| - $report->process($this->getPathCoverageForBankAccount(), self::$TEST_TMP_PATH); |
| 46 | + $report->process($this->getPathCoverageForBankAccount(), TEST_FILES_PATH . 'tmp'); |
58 | 47 |
|
59 |
| - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); |
| 48 | + $this->assertFilesEquals($expectedFilesPath, TEST_FILES_PATH . 'tmp'); |
60 | 49 | }
|
61 | 50 |
|
62 | 51 | public function testPathCoverageForSourceWithoutNamespace(): void
|
63 | 52 | {
|
64 |
| - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'PathCoverageForSourceWithoutNamespace'; |
| 53 | + $expectedFilesPath = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML' . DIRECTORY_SEPARATOR . 'PathCoverageForSourceWithoutNamespace'; |
65 | 54 |
|
66 | 55 | $report = new Facade;
|
67 |
| - $report->process($this->getPathCoverageForSourceWithoutNamespace(), self::$TEST_TMP_PATH); |
| 56 | + $report->process($this->getPathCoverageForSourceWithoutNamespace(), TEST_FILES_PATH . 'tmp'); |
68 | 57 |
|
69 |
| - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); |
| 58 | + $this->assertFilesEquals($expectedFilesPath, TEST_FILES_PATH . 'tmp'); |
70 | 59 | }
|
71 | 60 |
|
72 | 61 | public function testForFileWithIgnoredLines(): void
|
73 | 62 | {
|
74 |
| - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines'; |
| 63 | + $expectedFilesPath = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML' . DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines'; |
75 | 64 |
|
76 | 65 | $report = new Facade;
|
77 |
| - $report->process($this->getCoverageForFileWithIgnoredLines(), self::$TEST_TMP_PATH); |
| 66 | + $report->process($this->getCoverageForFileWithIgnoredLines(), TEST_FILES_PATH . 'tmp'); |
78 | 67 |
|
79 |
| - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); |
| 68 | + $this->assertFilesEquals($expectedFilesPath, TEST_FILES_PATH . 'tmp'); |
80 | 69 | }
|
81 | 70 |
|
82 | 71 | public function testForClassWithAnonymousFunction(): void
|
83 | 72 | {
|
84 |
| - $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction'; |
| 73 | + $expectedFilesPath = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML' . DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction'; |
85 | 74 |
|
86 | 75 | $report = new Facade;
|
87 |
| - $report->process($this->getCoverageForClassWithAnonymousFunction(), self::$TEST_TMP_PATH); |
| 76 | + $report->process($this->getCoverageForClassWithAnonymousFunction(), TEST_FILES_PATH . 'tmp'); |
88 | 77 |
|
89 |
| - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); |
| 78 | + $this->assertFilesEquals($expectedFilesPath, TEST_FILES_PATH . 'tmp'); |
90 | 79 | }
|
91 | 80 |
|
92 | 81 | private function assertFilesEquals(string $expectedFilesPath, string $actualFilesPath): void
|
|
0 commit comments