我正在运行的示例https://docs.phalconphp.com/en/latest/reference/unit-testing.html我做了所有配置,但我面临着
C:''xampp''htdocs''myproject>phpunit tests/UnitTest.php
致命错误:在 中找不到类"单元测试用例" C:''xampp''htdocs''myproject''tests''Unit Test.php 在第 16 行
16号线是
类 单元测试扩展 ''单元测试用例 {
您需要
在文件夹中运行测试tests
。如该教程中所述:
这将运行 tests/目录下的任何测试。
从PHPunit.xml文件中可以看到
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./TestHelper.php"
backupGlobals="false"
backupStaticAttributes="false"
verbose="true"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="true">
<testsuite name="Phalcon - Testsuite">
<directory>./</directory>
</testsuite>
</phpunit>
目录设置为当前一个<directory>./</directory>
因此,运行如下测试:
C:'xampp'htdocs'myproject'tests>phpunit UnitTest.php