1<?php
2/*
3 * This file is part of the php-code-coverage package.
4 *
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace SebastianBergmann\CodeCoverage\Report;
12
13use SebastianBergmann\CodeCoverage\TestCase;
14
15/**
16 * @covers SebastianBergmann\CodeCoverage\Report\Text
17 */
18class TextTest extends TestCase
19{
20    public function testTextForBankAccountTest()
21    {
22        $text = new Text(50, 90, false, false);
23
24        $this->assertStringMatchesFormatFile(
25            TEST_FILES_PATH . 'BankAccount-text.txt',
26            str_replace(PHP_EOL, "\n", $text->process($this->getCoverageForBankAccount()))
27        );
28    }
29
30    public function testTextForFileWithIgnoredLines()
31    {
32        $text = new Text(50, 90, false, false);
33
34        $this->assertStringMatchesFormatFile(
35            TEST_FILES_PATH . 'ignored-lines-text.txt',
36            str_replace(PHP_EOL, "\n", $text->process($this->getCoverageForFileWithIgnoredLines()))
37        );
38    }
39
40    public function testTextForClassWithAnonymousFunction()
41    {
42        $text = new Text(50, 90, false, false);
43
44        $this->assertStringMatchesFormatFile(
45            TEST_FILES_PATH . 'class-with-anonymous-function-text.txt',
46            str_replace(PHP_EOL, "\n", $text->process($this->getCoverageForClassWithAnonymousFunction()))
47        );
48    }
49}
50