2017-01-10 64 views

回答

1

是的,这是很有可能的。从documentation

Laravel提供了几种测试表单的方法。类型,选择, 检查,附加和按下方法可让您与表单的所有输入进行交互。

进行了抽样检测情况会看起来像:

public function testNewUserRegistration() 
{ 
    $this->visit('/register') 
     ->type('Taylor', 'name') 
     ->check('terms') 
     ->press('Register') 
     ->seePageIs('/dashboard'); 
}