| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testWrite() |
||
| 26 | { |
||
| 27 | $testName = __CLASS__; |
||
| 28 | $testSuite = $this->prophesize(TestSuite::class); |
||
| 29 | $testSuite->getName() |
||
| 30 | ->willReturn($testName); |
||
| 31 | $testSuite->count() |
||
| 32 | ->willReturn(1); |
||
| 33 | |||
| 34 | putenv(EnvVariables::PROCESS_UNIQUE_ID . '=' . md5(__FILE__)); |
||
| 35 | $logFullPath = $this->getRandomTempDir() . md5(__FILE__) . '.json.log'; |
||
| 36 | |||
| 37 | $printer = new LogPrinter(); |
||
| 38 | |||
| 39 | $printer->startTestSuite($testSuite->reveal()); |
||
| 40 | |||
| 41 | $content = $this->getFileContent($logFullPath); |
||
| 42 | $this->assertJson($content); |
||
| 43 | $decodedJson = json_decode($content, true); |
||
| 44 | $this->assertEquals(['event' => 'suiteStart', 'suite' => $testName, 'tests' => 1], $decodedJson); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |