[英]phpunit command not working in lumen 5.6 running on ubuntu 16.04
測試目錄中只有兩個文件:TestCase.php和ExampleTest.php
下面是源代碼(這是一個全新的Lumen安裝,實際上未添加任何新測試,只是附帶的默認測試文件):
<?php
use Laravel\Lumen\Testing\DatabaseMigrations;
use Laravel\Lumen\Testing\DatabaseTransactions;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testExample()
{
$this->get('/');
$this->assertEquals(
$this->app->version(), $this->response->getContent()
);
}
}
我不斷收到錯誤消息
In Test.php line 100:
Neither "Application Test Suite.php" nor "Application Test Suite.php" could be opened.
所有作曲家所需的軟件包已安裝。 我正在使用Ubuntu 16.04 OS中的最新php 7.2版本的lampp安裝。
可能是什么問題? 該錯誤表明我什至找不到該Test.php文件。
問題是我安裝的最新Lampp隨附的phpunit版本是
PHPUnit 3.6.0 by Sebastian Bergmann.version 3.6.0
位於/ opt / lampp / bin / phpunit
這是具有最新php 7.2.1版本的同一安裝的一部分
但是推薦的版本是
PHPUnit 7.0.1 by Sebastian Bergmann and contributors.
當我嘗試從lumen應用程序的根目錄運行./vendor/phpunit/phpunit/phpunit時,它起作用了!!
因此,我必須創建別名phpunit =“ / opt / lampp /..../ vendor / phpunit / phpunit / phpunit”,以便更輕松地調用phpunit測試
您的ExampleTest.php文件似乎不是問題。 檢出第100行的文件Test.php。即使它是一個新項目,您也已經添加或更改了Test文件,這現在就造成了麻煩。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.