wsteel/tp60unit
Composer 安装命令:
composer require wsteel/tp60unit
包简介
A simple unit test for thinkphp6.0
README 文档
README
test thinkphp6.0 app's logic by phpstorm 2020
usage
composer require wsteel/php60unit
require
"php": ">=7.2.0",
"topthink/framework": "6.0.*"
"phpunit/phpunit": "8.*"
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\autoload.php
demo
filename
tests/demo/demoTest.php
content
namespace tests\demo; use wsteel\tp60unit\TestCase; class demoTest extends TestCase { public function testTrue() { $this->assertTrue(true); } public function testFalse() { $this->assertFalse(false, 'false'); } public function testModel() { $e = \app\model\User::find(1); dump($e); $this->assertNotEmpty($e); } public function testDB() { $user = Db::name('user'); $e = $user->where('id', '=' ,1)->select(); dump($e); $this->assertNotEmpty($e); } public function testConfig() { $config = config('database'); dump($config); $this->assertNotEmpty($config); } }
统计信息
- 总下载量: 71
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-24