定制 wsteel/tp51unit 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

wsteel/tp51unit

Composer 安装命令:

composer require wsteel/tp51unit

包简介

A simple unit test for thinkphp5.1

README 文档

README

test thinkphp5.1 app's logic by phpstorm 2019

usage

composer require wsteel/php51unit

require

"php": ">=7.0.0",
"topthink/framework": "5.1.*"
"phpunit/phpunit": "6.*"

phpstorm setting

File | Settings | Languages & Frameworks | PHP | Test Frameworks

PHPUnit library -> Path to phpunit.phar -> _YOUR_phpunit-*.phar

Test Runner -> Default bootstrap file:  __YOUR_APP__\vendor\wsteel\tp51unit\src\wsteel\tp51unit\TestCase.php

demo

filename

tests/demo/demoTest.php

content

namespace tests\demo;

use wsteel\tp51unit\TestCase;

class demoTest extends TestCase
{

    public function testTrue()
    {
        $this->assertTrue(true);
    }

    public function testFalse()
    {
        $this->assertFalse(false, 'false');
    }


    public function testModel()
    {
        $e = \app\serverapi\model\Users::get(1)->toArray();
        $this->assertNotEmpty($e);
    }

    public function testM()
    {
        $user = model('users', 'serverapi\model');
        $e = $user->where('id', 1)->find()->toArray();
        $this->assertNotEmpty($e);
    }

    public function testDB()
    {
        $user = \think\Db::name('server_user');
        $e = $user->where('id', 1)->find();
        $this->assertNotEmpty($e);
    }

    public function testConfig()
    {
        $config = config('serverapi');
        $this->assertNotEmpty($config);
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固