我正在使用Symfony 3.4。突然,每当我尝试在/ tests中运行测试(phpunit)时,都会出现以下错误:
RuntimeException : Unable to guess the Kernel directory.
Run Code Online (Sandbox Code Playgroud)
我的测试课看起来像:
class PaymentCreditTest extends KernelTestCase
{
/** @var PaymentRepository */
public $paymentRepository;
/**
* {@inheritDoc}
*/
protected function setUp()
{
$this->paymentRepository = self::bootKernel()->getContainer()->get('chaku.repository.payment');
}
public function test_canRetrieveDeadFreightNetAmount()
{
/** @var Payment $payment */
$payment = $this->paymentRepository->findOneBy(['id' => 1000002]);
// just to see payment object
dump($payment);
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的phpunit.xml.dist的样子:
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="app/autoload.php">
<php>
<ini name="error_reporting" value="-1" />
<server name="KERNEL_CLASS" value="AppKernel" /> …Run Code Online (Sandbox Code Playgroud) 我想念什么吗?这是我所拥有的:
var express = require('express');
var favicon = require('serve-favicon');
var path = require('path');
var app = express();
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use('/api', require('./routes/api'));
app.listen(3000);
Run Code Online (Sandbox Code Playgroud)
我的网站图标的位置与公用文件夹中指定的名称相同。我在文件中单独设置了一些其他路由。该收藏夹图标似乎没有起作用,我必须丢失了一些东西。