konecnyjakub/phpt-runner 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

konecnyjakub/phpt-runner

最新稳定版本:0.4.0

Composer 安装命令:

composer require konecnyjakub/phpt-runner

包简介

PHPT tests runner

README 文档

README

Total Downloads Latest Stable Version build status coverage report License

This library allows running phpt tests. The format and possible sections are described on https://php.github.io/php-src/miscellaneous/writing-tests.html.

Installation

The best way to install PHPT Runner is via Composer. Just add konecnyjakub/phpt-runner to your (dev) dependencies.

Quick start

<?php
declare(strict_types=1);

use Konecnyjakub\PHPTRunner\Parser;
use Konecnyjakub\PHPTRunner\PhpRunner;
use Konecnyjakub\PHPTRunner\PhptRunner;
use Konecnyjakub\PHPTRunner\TestsRunner;

$testsRunner = new TestsRunner(new PhptRunner(new Parser(), new PhpRunner()));
$results = $testsRunner->run(__DIR__ . "/tests");

TestsRunner walks through all .phpt files in the given directory (but not subdirectories at the moment), runs them and returns an instance of Konecnyjakub\PHPTRunner\TestsResultSet.

Advanced usage

To be added

Fully implemented and tested sections

These sections work exactly as described in the documentation. If you notice any differences, please report them as a bug.

  • --TEST--
  • --DESCRIPTION--
  • --SKIPIF--
  • --CAPTURE_STDIO--
  • --GET--
  • --COOKIE--
  • --STDIN--
  • --INI--
  • --ARGS--
  • --ENV--
  • --FILE--
  • --FILEEOF--
  • --FILE_EXTERNAL--
  • --CGI--
  • --XFAIL--
  • --FLAKY--
  • --EXPECTHEADERS--
  • --EXPECT--
  • --EXPECT_EXTERNAL--
  • --EXPECTREGEX--
  • --EXPECTREGEX_EXTERNAL--
  • --CLEAN--

Partially implemented sections

These sections are used by PhptRunner but there are some differences from behavior described in the documentation. We want to eventually eliminate the differences.

  • --EXTENSIONS-- (we do not try to load those extensions, we just skip the test if any of those extensions is not loaded)
  • --POST-- (it forces the use of the cgi binary but is not passed to it)
  • --EXPECTF-- (regular expressions %r...%r are not supported)
  • --EXPECTF_EXTERNAL-- (regular expressions %r...%r are not supported)

Parsed but not implemented sections

These sections are parsed by Parser and returned in ParsedFile but PhptRunner does not use them.

  • --CONFLICTS--
  • --PHPDBG--
  • --REDIRECTTEST--

Ignored sections

These sections are completely ignored by both Parser and PhptRunner right now. There is no guarantee that they will be (fully) implemented.

  • --CREDITS--
  • --WHITESPACE_SENSITIVE--
  • --POST_RAW--
  • --PUT--
  • --GZIP_POST--
  • --DEFLATE_POST--

统计信息

  • 总下载量: 291
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2025-05-08