use PHPUnit\Framework\TestSuite; use PHPUnit\TextUI\TestRunner; $suite = new TestSuite(); $suite->addTestSuite('MyTest'); $runner = new TestRunner(); $runner->doRun($suite);
use PHPUnit\Framework\TestSuite; use PHPUnit\TextUI\TestRunner; $loader = require 'vendor/autoload.php'; $suite = new TestSuite(); $suite->addTestFiles(glob('tests/*.php')); $runner = new TestRunner(); $runner->doRun($suite);This example uses Composer to load the PHPUnit package and adds all test files in the "tests" directory to the TestSuite object. Then, it runs the tests using the TestRunner object. In conclusion, PHPUnit_TextUI_TestRunner is a class in the PHPUnit package library that provides a command-line interface for running PHPUnit tests. It allows developers to easily run tests and provides detailed output on test results.