测试用例在网络调用时意外停止,在此函数之前几乎没有测试用例,一切顺利,但是当测试过程点击此testMemberRegister
函数时控制台挂起。
更新1:如果我删除$ params,则通话结束。 更新2:问题与phpunit无关,寄存器流产生巨大的数据库计算。
PHPUnit 4.8.35 by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.3-3+deb.sury.org~xenial+1
" laravel / framework":" 5.2。*"`
public function testMemberRegister() {
$data = $this->registerApp();
$client_token = $data->access_token;
$this->log('Point A');
$params = [
'access_token' => $client_token,
'contact_no' => '12345678',
'lang' => 'en',
'password' => '12345678',
'nickname' => $this->getNickname('2'),
'username' => $this->getNickname('2') . '@example.com',
'referral' => $this->getNickname('1') . '@example.com',
];
$this->log('Point B');
$res = $this->call('POST', '/api/v1/user/register', $params);
$this->log('Point C');
if ($res->status() != 200) {
print $res->content();
}
$this->assertEquals(200, $res->status());
...
}
Point A
getNickname
getNickname
getNickname
Point B