PHPackages                             cjs/phpunit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. cjs/phpunit

ActiveLibrary[Testing &amp; Quality](/categories/testing)

cjs/phpunit
===========

The jelly phpunit package

12541PHP

Since Feb 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jellycheng/cjsPhpunit)[ Packagist](https://packagist.org/packages/cjs/phpunit)[ RSS](/packages/cjs-phpunit/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

### php单元测试

[](#php单元测试)

```
preg_match('/APP_ENV=(\w+)/',$env, $matches);
```

\###命名规则

```
单元测试方法以test* 开头， 如testLogin()
单元测试类以Test结尾，如class UserLoginTest extends \CjsPhpunit\TestCaseBase

```

### phpunit phar

[](#phpunit-phar)

```
PHPUnit 4.8 支持 PHP 5.3, PHP 5.4, PHP 5.5, 和 PHP 5.6
PHPUnit 5.7 支持 PHP 5.6, PHP 7.0, 和 PHP 7.1
https://phar.phpunit.de/
https://phar.phpunit.de/phpunit.phar

linux下安装
wget https://phar.phpunit.de/phpunit.phar
➜ chmod +x phpunit.phar
➜ sudo mv phpunit.phar /usr/local/bin/phpunit
➜ phpunit --version

```

### phpunit

[](#phpunit)

```
查看版本： phpunit.phar --version
   php phpunit-4.8.31.phar --version
   php phpunit-5.7.5.phar --version

```

```

    设置php的$_ENV值

以上xml配置对应php代码如下：
ini_set('foo', 'bar');
define('foo', 'bar');
$GLOBALS['foo'] = 'bar';
$_ENV['foo'] = 'bar';
$_POST['foo'] = 'bar';
$_GET['foo'] = 'bar';
$_COOKIE['foo'] = 'bar';
$_SERVER['foo'] = 'bar';
$_FILES['foo'] = 'bar';
$_REQUEST['foo'] = 'bar';

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5674717?v=4)[jellycheng](/maintainers/jellycheng)[@jellycheng](https://github.com/jellycheng)

---

Top Contributors

[![jellycheng](https://avatars.githubusercontent.com/u/5674717?v=4)](https://github.com/jellycheng "jellycheng (11 commits)")

### Embed Badge

![Health badge](/badges/cjs-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/cjs-phpunit/health.svg)](https://phpackages.com/packages/cjs-phpunit)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M346](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
