Download the PHP package yunbuye/thinkphp-testing without Composer

On this page you can find all versions of the php package yunbuye/thinkphp-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 thinkphp-testing

yunbuye/thinkphp-testing

一个测试友好的ThinkPHP测试扩展

安装

修改 phpunit.xml 文件,在 phpunit 标签加入 bootstrap="vendor/autoload.php"

使用时注意

  1. 测试类必须继承 Yunbuye\ThinkTesting\TestCase 测试类
  2. 如果不是使用thinkPHP命令(php think unit) 运行的测试,需要设置 $app_path 和加载基础文件。
    例:

功能

  1. 模拟对象
    只要是使用容器进行管理的对象,都可以使用以下方法进行模拟(具体的 Mockery 使用方法,请参考 文档

    为了让以上过程更加便捷:

    同样,如果你想侦查一个对象,基本测试用例类提供了一个便捷的 spy 方法作为 Mockery::spy 的替代方法:

  2. 每次测试后数据库回滚
    每次运行测试用例后,为了不互相污染数据,可以选择数据库回滚。
    例:

  3. Facade mock 模拟
    安装扩展(不要加--dev)

    具体使用,请参考 yunbuye/thinkphp-facade

  4. 模型工厂
    安装扩展(加--dev)

    具体使用,请参考 yunbuye/thinkphp-model-factory


All versions of thinkphp-testing with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
fzaninotto/faker Version ~1.0
topthink/framework Version 5.1.*
mockery/mockery Version ^0.9.5
phpunit/phpunit Version ^6.0
topthink/think-testing Version 2.0.*
ext-json Version *
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 yunbuye/thinkphp-testing contains the following files

Loading the files please wait ....