wsteel / tp60unit
A simple unit test for thinkphp6.0
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:phpunit
This package is auto-updated.
Last update: 2024-09-24 14:01:05 UTC
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); } }