【发布时间】:2019-06-16 23:55:23
【问题描述】:
我已经在我的 CakePHP 应用程序中设置了 PHPUnit,
但是当我尝试运行它时,我收到了这个错误:
Cake\View\Exception\MissingTemplateException:模板文件“Error/error500.ctp”丢失。
我已经尝试了几次 phpunit.xml.dist 页面的不同设置,但没有任何变化。
代码如下:
public function testLogin()
{
$this->get("/admin/users/login");
$this->assertResponseOk();
}
我尝试在 tests/TestCase/Controller/Admin/UsersControllerTest.php 中测试的非常简单的方法
【问题讨论】:
-
请发布属于该错误的堆栈跟踪。另外,您的
tests/bootstrap.php文件是什么样的? -
这里是测试/bootstrap.php
<?php /** * Test runner bootstrap. * * Add additional configuration/setup your application needs when running * unit tests in this file. */ require dirname(__DIR__) . '/vendor/autoload.php'; require dirname(__DIR__) . '/config/bootstrap.php'; $_SERVER['PHP_SELF'] = '/';