私はこの簡単なテストを書きました:
<?php
namespace Hello\ApiBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class HelloControllerTest extends WebTestCase {
public function test() {
$client = static::createClient();
$crawler = $client->request("GET","http://localhost/hello");
$response = $client->getResponse()->getStatusCode();
var_dump($response);
}
}
?>
このテストを実行すると、404 ステータス コードが出力されます。
奇妙なことに、ngninx のアクセス ログにリクエストが表示されません。URL を変更し"/hello"
ても、リクエストがローカル Web サーバーに到達していないように見えます。
言うまでもなく、Chrome を開いてこの URL ( http://localhost/hello
) を普通に試すだけで機能します。
- 私は何が欠けていますか?