Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function testExport(): void |
||
32 | { |
||
33 | $profiler = new Profiler($this->logger); |
||
34 | |||
35 | $filename = $this->testFilePath . DIRECTORY_SEPARATOR . 'test.txt'; |
||
36 | |||
37 | $target = new FileTarget(); |
||
38 | $target->setFilename($filename); |
||
39 | $profiler->addTarget($target); |
||
40 | |||
41 | $profiler->begin('test-export', ['category' => 'test-category']); |
||
42 | $profiler->end('test-export', ['category' => 'test-category']); |
||
43 | |||
44 | $profiler->flush(); |
||
45 | |||
46 | $this->assertFileExists($filename); |
||
47 | |||
48 | $fileContent = file_get_contents($filename); |
||
49 | $this->assertStringContainsString('[test-category] test-export', $fileContent); |
||
50 | } |
||
52 |