0
當我嘗試使用自定義域這樣Laravel5.3的PHPUnit不工作
<?php
abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://localhost';
protected $prefixDomain = '';
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
$this->setBaseUrl();
return $app;
}
protected function setBaseUrl()
{
$this->baseUrl = env('APP_URL', $this->baseUrl);
if ($this->prefixDomain) {
$this->baseUrl = substr_replace(
$this->prefixDomain,
$this->baseUrl,
strlen('https://'),
0
);
}
}
自定義域我設置「APP_URL」在.ENV文件
好像請求URI不權當我傾倒和光照明\路由\ RouteCollection.php死
/**
* Find the first route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
public function match(Request $request)
{
dd($request);
$routes = $this->get($request->getMethod());
我希望這裏的輸出是「REQUEST_URI」 =>「/測試」,但實際上
在此先感謝您的幫助。