Download the PHP package fangx/testing without Composer

On this page you can find all versions of the php package fangx/testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package testing

hyperf-testing

Hyperf 中单元测试增强扩展包

在 hyperf 中使用数据库进行单元测试.

推荐使用 fangx/sqlite-driver 作为数据库驱动进行测试.

为了保证测试独立, 所以每个测试完成后都会重新刷新容器. 该情况下会导致使用异步协程情况的时候, 使用 ApplicationContext::getContainer() 每次获取到的容器可能不一样 在异步里面应该避免直接使用 ApplicationContext::getContainer() 获取容器的相关内容. Hyperf 官方推荐做法是通过构造函数直接直接注入 Container, 而不是每次使用容器都通过 ApplicationContext::getContainer() 获取.

安装

使用

Hyperf 2.0 使用 2.1 版本, Hyperf 2.1 使用 3.* 版本

  • Fangx\Testing\Concerns\CommandCaller: 提供 command() 方法, 在程序中执行命令.
  • Fangx\Testing\Concerns\DatabaseMigrations: 参照 laravel. 需要依赖 CommandCaller 执行迁移命令.
  • Fangx\Testing\Concerns\RefreshDatabase: 参照 laravel. 需要依赖 CommandCaller 执行迁移命令.
  • Fangx\Testing\Concerns\DatabaseTransactions: 参照 laravel.

运行迁移时, 默认执行的是 migrations/testing 目录下的迁移文件. 可以通过设置 getMigrationsPath 方法来自定义迁移文件的目录

使用命令创建

直接创建

在项目中的测试目录下创建 Units/UserTest.php 填入一下内容.


All versions of testing with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-swoole Version >=4.5
hyperf/contract Version 2.*
hyperf/db-connection Version 2.*
hyperf/devtool Version 2.*
hyperf/di Version 2.*
hyperf/utils Version 2.*
phpunit/phpunit Version ^9.0
psr/container Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fangx/testing contains the following files

Loading the files please wait ...