承接 bariew/yii2-doctest-extension 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bariew/yii2-doctest-extension

最新稳定版本:3.0.0

Composer 安装命令:

composer require bariew/yii2-doctest-extension

包简介

Runs crawler to test site pages accessibility

README 文档

README

If you don't have a time to write tests.

Description

This extension is for testing without test writing. It doe few things.

  1. It uses Curl to visit all your app pages (it finds them too) and submits all found forms just to make sure they are generally ok. It is useful to avoid critical errors like 404 or 500 error pages.

  2. It takes your docblock @example tag and runs its content as assert expression. See examples below.

  3. It also runs you url get and post requests, e.g. you can test your controller, eg API. with @example tags for each method.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist bariew/yii2-doctest-extension "*"

or add

"bariew/yii2-doctest-extension": "*"

to the require section of your composer.json file.

Unit tests:

  1. define @example docblock in your tested class method descriptions:
    /**
     * Returns user default name
     * @return string name.
     * @example $this->getDefaultName() == "Mr. Smith"
     */
    protected function getDefaultName()
    {
        return "Mr. Smith"
    }
  1. Call UnitTest from your test script:
    $docTester = new \bariew\docTest\UnitTest("app\models\User");
    $docTester->test();

Url tests:

  1. define @example docblocks in your target class method descriptions:
    $this->post("http://mySite.com/myPath", ["myParam"=>"MyValue"]) == '{"code":200, "message":"OK"}'
  1. Call DocTest from your test script:
    $docTester = new \bariew\docTest\UrlTest("app\controllers\UserController");
    $docTester->test();
  1. Click tests. See in examples folder.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固