Php Laravel:测试无法查看所需的文本
我的测试很正常,但今天却出现了奇怪的错误:Php Laravel:测试无法查看所需的文本,php,phpunit,laravel-5.1,Php,Phpunit,Laravel 5.1,我的测试很正常,但今天却出现了奇怪的错误: vagrant@todo:~/todo.dev$ vendor/bin/phpunit --filter UserSignupTest::testSuccessfullRegister PHPUnit 4.8.6 by Sebastian Bergmann and contributors. FUser added with id 80 and the role FULL assigned to it<br>Task Added with
vagrant@todo:~/todo.dev$ vendor/bin/phpunit --filter UserSignupTest::testSuccessfullRegister
PHPUnit 4.8.6 by Sebastian Bergmann and contributors.
FUser added with id 80 and the role FULL assigned to it<br>Task Added with title "Clean room" by the user with id: 80
Time: 1.54 seconds, Memory: 19.50Mb
There was 1 failure:
1) UserSignupTest::testSuccessfullRegister
Failed asserting that '' matches PCRE pattern "/(added|added)/i".
/home/vagrant/todo.dev/vendor/laravel/framework/src/Illuminate/Foundation/Testing/CrawlerTrait.php:278
页面是要被重定向还是通过ajax获得响应?@Rosswelson否。它不是重定向。这是一个简单的表单提交。在这种情况下,您可以发布处理请求的控制器方法的内容吗?控制器以db和echo文本的形式提交一条记录。页面是要重定向还是通过ajax获得响应?@RossWilson否。它不是重定向。这是一个简单的表单提交。在这种情况下,您可以发布处理请求的控制器方法的内容吗
public function testSuccessfullRegister()
{
$this->withSession(['title' => 'Clean room','summary'=>'Clean Room','files'=>'no'])
->visit('/auth/register')
->type('Steve','first_name')
->type('Jobs','last_name')
->type('steve@apple.com','email')
->type('stevegivesjobs','password')
->press("Go!!!")
->see("added");
}