From 842c0172cb01f1741805dd43c447dfe8b07e6c7a Mon Sep 17 00:00:00 2001 From: sasezaki Date: Fri, 29 Jan 2021 22:27:38 +0900 Subject: [PATCH] replace useless specific output file to temp file at test. --- tests/OutputFormatter/BaselineOutputFormatterTest.php | 3 ++- tests/OutputFormatter/data/generated-baseline.yml | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 tests/OutputFormatter/data/generated-baseline.yml diff --git a/tests/OutputFormatter/BaselineOutputFormatterTest.php b/tests/OutputFormatter/BaselineOutputFormatterTest.php index 09493a609..f46062073 100644 --- a/tests/OutputFormatter/BaselineOutputFormatterTest.php +++ b/tests/OutputFormatter/BaselineOutputFormatterTest.php @@ -98,7 +98,7 @@ public function basicDataProvider(): iterable */ public function testBasic(array $rules, string $expectedOutput): void { - $generatedBaselineFile = __DIR__.'/data/generated-baseline.yml'; + $generatedBaselineFile = tempnam(sys_get_temp_dir(), 'deptrac_'); $output = new BufferedOutput(); $formatter = new BaselineOutputFormatter(); @@ -112,6 +112,7 @@ public function testBasic(array $rules, string $expectedOutput): void $expectedOutput, file_get_contents($generatedBaselineFile) ); + unlink($generatedBaselineFile); } public function testGetOptions(): void diff --git a/tests/OutputFormatter/data/generated-baseline.yml b/tests/OutputFormatter/data/generated-baseline.yml deleted file mode 100644 index 1c28cb2e3..000000000 --- a/tests/OutputFormatter/data/generated-baseline.yml +++ /dev/null @@ -1,3 +0,0 @@ -skip_violations: - ClassA: - ClassB: ClassB