1<?php
2/*
3 * This file is part of PHPUnit.
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
11/**
12 * Prints TestDox documentation in text format.
13 */
14class PHPUnit_Util_TestDox_ResultPrinter_Text extends PHPUnit_Util_TestDox_ResultPrinter
15{
16    /**
17     * Handler for 'start class' event.
18     *
19     * @param string $name
20     */
21    protected function startClass($name)
22    {
23        $this->write($this->currentTestClassPrettified . "\n");
24    }
25
26    /**
27     * Handler for 'on test' event.
28     *
29     * @param string $name
30     * @param bool   $success
31     */
32    protected function onTest($name, $success = true)
33    {
34        if ($success) {
35            $this->write(' [x] ');
36        } else {
37            $this->write(' [ ] ');
38        }
39
40        $this->write($name . "\n");
41    }
42
43    /**
44     * Handler for 'end class' event.
45     *
46     * @param string $name
47     */
48    protected function endClass($name)
49    {
50        $this->write("\n");
51    }
52}
53