Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用Laracasts\Integrated选择多个选项_Php_Unit Testing_Laravel 5 - Fatal编程技术网

Php 使用Laracasts\Integrated选择多个选项

Php 使用Laracasts\Integrated选择多个选项,php,unit-testing,laravel-5,Php,Unit Testing,Laravel 5,我正在使用Laracasts\Integrated library测试我的web应用程序。我有一张这样的表格: <select multiple name="resource[]"> <option value="Coal">Coal</option> <option value="Another">Aluminum</option> . . </select> 我得到一个错误: Symfony\Component\Cs

我正在使用Laracasts\Integrated library测试我的web应用程序。我有一张这样的表格:

<select multiple name="resource[]"> 
<option value="Coal">Coal</option>
<option value="Another">Aluminum</option>
.
.
</select>
我得到一个错误:

Symfony\Component\CssSelector\Exception\SyntaxErrorException:  Expected identifier│ or "*", but <delimiter "]" at 11> found.
Symfony\Component\CssSelector\Exception\SyntaxErrorException:预期的标识符│ 或“*”,但已找到。

请帮帮我。

我通过帮助Gal获得的解决方案:

我的测试用例:

/**@test*/
public function add_new()
{
 $this->storeInput('resource', ['6PGM+Au' ,'Coal'], true)
      ->andPress('Submit')
}


   public function storeInput($element, $text, $force = false)
    {
        if ($force) {
            $this->inputs[$element] = $text;
            return $this;
        }
        else {
            return parent::storeInput($element, $text);
        }
    }

你把这条线放在哪里?
这个
包含什么?[哪个对象]由于laravel不支持
html
/
form
类,因此您需要遵循本指南-才能做到这一点。我正在使用Laracasts/Integrated library进行测试。。() .. .... 我正在测试一个网站,我需要做一些测试用例:公共函数make_new_contract(){$this->select('resource[],['Coal','other']);确保您使用的是最新版本的软件包,并检查
makeRequestUsingForm
inside
src/Extensions/Laravel.php
方法是否看起来不起作用,如果不起作用,您可以试试这个sulotion-@Gal谢谢您的回答它起作用了……我还有一个问题……我希望您能解决这个问题……请帮我一次忙我对堆栈溢出一无所知
/**@test*/
public function add_new()
{
 $this->storeInput('resource', ['6PGM+Au' ,'Coal'], true)
      ->andPress('Submit')
}


   public function storeInput($element, $text, $force = false)
    {
        if ($force) {
            $this->inputs[$element] = $text;
            return $this;
        }
        else {
            return parent::storeInput($element, $text);
        }
    }