本文整理汇总了PHP中TestSuite::collect方法的典型用法代码示例。如果您正苦于以下问题:PHP TestSuite::collect方法的具体用法?PHP TestSuite::collect怎么用?PHP TestSuite::collect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::collect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# load required files
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once 'simpletest/collector.php';
require_once 'simpletest/mock_objects.php';
require_once 'varstream.php';
$project_path = dirname(dirname(__FILE__));
$lib_path = $project_path . '/lib/src/';
# load required files
require_once $lib_path . 'dispatcher.php';
require_once $lib_path . 'response.php';
require_once $lib_path . 'controller.php';
require_once $lib_path . 'inflector.php';
require_once $lib_path . 'flash.php';
require_once $lib_path . 'exception.php';
# load flexi lib
require_once $project_path . '/vendor/flexi/flexi.php';
# load all mocks
require_once 'lib/mocks.php';
# collect all tests
$all = new TestSuite('All tests');
$all->collect(dirname(__FILE__) . '/lib', new SimplePatternCollector('/test.php$/'));
# use text reporter if cli
if (sizeof($_SERVER['argv'])) {
$all->run(new TextReporter());
} else {
$all->run(new HtmlReporter());
}