首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Laracast\Integrated选择多个选项

使用Laracast\Integrated选择多个选项
EN

Stack Overflow用户
提问于 2015-09-21 13:41:56
回答 1查看 182关注 0票数 1

我正在使用Laracast\Integrated库来测试我的web应用程序。我有一个这样的表单:

代码语言:javascript
运行
复制
<select multiple name="resource[]"> 
<option value="Coal">Coal</option>
<option value="Another">Aluminum</option>
.
.
</select>

我的测试用例是:

代码语言:javascript
运行
复制
$this->select('resource[]' , ['Coal' , 'Another']);

我得到了错误:

代码语言:javascript
运行
复制
Symfony\Component\CssSelector\Exception\SyntaxErrorException:  Expected identifier│ or "*", but <delimiter "]" at 11> found.

请帮帮我。

EN

回答 1

Stack Overflow用户

发布于 2015-09-22 19:34:40

我通过help Gal得到的解决方案:

代码语言:javascript
运行
复制
/**@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);
        }
    }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32688060

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档