# Test::Unit::Result - unit testing framework helper class - perldoc - [phpMan]

## NAME
    [Test::Unit::Result](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3AResult/markdown) - unit testing framework helper class

## SYNOPSIS
    This class is not intended to be used directly

## DESCRIPTION
    This class is used by the framework to record the results of tests, which will throw an instance
    of a subclass of [Test::Unit::Exception](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3AException/markdown) in case of errors or failures.

    To achieve this, this class gets called with a test case as argument. It will call this test
    case's run method back and catch any exceptions thrown.

    It could be argued that [Test::Unit::Result](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3AResult/markdown) is the heart of the PerlUnit framework, since
    TestCase classes vary, and you can use one of several [Test::Unit::TestRunners](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3ATestRunners/markdown), but we always
    gather the results in a [Test::Unit::Result](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3AResult/markdown) object.

    This is the quintessential call tree of the communication needed to record the results of a
    given test:

        $aTestCase->run() {
            # creates result
            $aTestResult->run($aTestCase) {
                # catches exception and records it
                $aTestCase->run_bare() {
                    # runs test method inside eval
                    $aTestCase->run_test() {
                        # calls method $aTestCase->name()
                        # and propagates exception
                        # method will call [Assert::assert](https://www.chedong.com/phpMan.php/perldoc/Assert%3A%3Aassert/markdown)()
                        # to cause failure if test fails on
                        # test assertion
                        # it finds this because $aTestCase is-a Assert
                    }
                }
            }
        }

    Note too that, in the presence of [Test::Unit::TestSuites](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3ATestSuites/markdown), this call tree can get a little more
    convoluted, but if you bear the above in mind it should be apparent what's going on.

## AUTHOR
    Copyright (c) 2000-2002, 2005 the PerlUnit Development Team (see [Test::Unit](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit/markdown) or the AUTHORS file
    included in this distribution).

    All rights reserved. This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

## SEE ALSO
    *   [Test::Unit::Assert](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3AAssert/markdown)

    *   [Test::Unit::TestCase](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3ATestCase/markdown)

    *   [Test::Unit::Exception](https://www.chedong.com/phpMan.php/perldoc/Test%3A%3AUnit%3A%3AException/markdown)

