我在目录 f:\lara_app 中安装了一个 Laravel 应用程序。我使用 PHP artisan serve 来运行应用程序。我有 Laravel 版本 5.4.36(通过 Composer 安装)
我并没有尝试使用 PHP 单元进行测试。在 f:/lara_app/tests/Unit/ExampleTest.php 中,我有以下代码:
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
public function myFirstTest()
{
$value = 'Hello World';
$this->assertTrue( 'Hello' === $value, 'Value should be Hello World');
}
}
我现在尝试从我的命令提示符运行测试:
f:\lara_app> .vendor/phpunit/phpuni/phpunit
但我收到以下消息:
'.vendor' 不是内部或外部命令,也不是可运行的程序或批处理文件
如何运行 PHPUnit 测试?
提前致谢
最佳答案
使用引号:
"./vendor/bin/phpunit"
关于php - 如何从 Windows 命令提示符在 Laravel 中运行 PHPUnit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51093354/