hgsgtk / mpunit

Mini PHP xUnit Testing Framework
https://speakerdeck.com/hgsgtk/self-made-xunit
MIT License
16 stars 1 forks source link

TestCase implements "standard test interface" #19

Closed hgsgtk closed 4 years ago

hgsgtk commented 4 years ago

TestSuite and TestCase

Command pattern

/**
 * A Test can be run and collect its results.
 */
interface Test extends Countable
{
    /**
     * Runs a test and collects its result in a TestResult instance.
     */
    public function run(TestResult $result = null): TestResult;
}

Test interfaceを実装している、また Countable interface も実装している このrun() に対しては、TestRunnerのみが依存している