2017-12-28 31 views
0

このエラーは何ですか? laravelで簡単なテストを作成する方法。テストは実行されていません! laravel 5.4

PHPUnit 6.3.1 by Sebastian Bergmann and contributors。

時間:130 ms、メモリ:4.00MB

テストは実行されませんでした。

テスト/機能/ ReadArticle.php

<?php 

namespace Tests\Feature; 

use Tests\TestCase; 
use Illuminate\Foundation\Testing\WithoutMiddleware; 
use Illuminate\Foundation\Testing\DatabaseMigrations; 
use Illuminate\Foundation\Testing\DatabaseTransactions; 

class ReadArticle extends TestCase 
{ 
    /** 
    * @test 
    */ 
    public function a_user_can_view_home_page() 
    { 
     $this->get('/')->assertSee('وبسایت اکسبیر'); 
    } 
} 
+0

どのようにテストを実行しますか?実行したコマンドは何ですか? – Shiro

+0

composer global phpunit/phpunitが必要です –

+0

[PHPUnit - '設定ファイルを使用しているときにテストが実行されませんでした'](https://stackoverflow.com/questions/29299206/phpunit-no-tests-executed-when-using-configuration) -file) –

答えて

2

2の可能性:

あなたのテストは

class ReadArticleTest extends TestCase 

する必要があり、そのファイル名が

ありますlaraveの代わりにあなたのグローバルなPHPunitを使用するかもしれません私は1つです。あなたはCMDラインを使用した場合は入力し

./vendor/bin/phpunit 
1

はこれを試してみてください"./vendor/bin/phpunit"ルートアプリケーションに。引用符を忘れないでください!

関連する問題