PHPUnit / Laravel 5.2中无法访问的字段“isTeam0”

时间:2016-01-29 22:45:52

标签: php laravel phpunit

我有一个复选框:

<input class="switch" data-on-text="Si" data-off-text="No" id="isTeam0" 
checked="checked" name="isTeam" type="checkbox" value="1">

当我尝试使用以下功能进行功能测试时

$this->visit('/tournaments/' . $tournament->id . '/edit')
        ->type('1', 'isTeam0')
        ->press('save0');

我收到此错误消息:

1) TournamentTest::it_create_tournament_category_conf

InvalidArgumentException:无法访问的字段“isTeam0”

/home/vagrant/Code/vendor/symfony/dom-crawler/FormFieldRegistry.php:89
/home/vagrant/Code/vendor/symfony/dom-crawler/FormFieldRegistry.php:126
/home/vagrant/Code/vendor/symfony/dom-crawler/Form.php:77
/home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php:711
/home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php:691
/home/vagrant/Code/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php:678
/home/vagrant/Code/tests/functional/TournamentTest.php:187

我不知道该怎么做才能让它发挥作用......

任何想法???

0 个答案:

没有答案