自动化测试

Testing Is Documentation

tests/Docs/TestDoc.php测试 - 图1

QueryPHP 自身经过大量的单元测试用例验证过,取得了非常好的效果,对于业务层测试来说,我们也提供了基础的测试功能。

基本使用方法

fixture 定义

tests/Example/ExampleTest.php

  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the your app package.
  5. *
  6. * The PHP Application For Code Poem For You.
  7. * (c) 2018-2099 http://yourdomian.com All rights reserved.
  8. *
  9. * For the full copyright and license information, please view the LICENSE
  10. * file that was distributed with this source code.
  11. */
  12. namespace Tests\Example;
  13. use Tests\TestCase;
  14. /**
  15. * 继承框架基础示例.
  16. */
  17. class ExampleTest extends TestCase
  18. {
  19. public function testBaseUse(): void
  20. {
  21. $this->assertSame('QueryPHP', 'QueryPHP');
  22. }
  23. }