Sanpi\Behatch\Context\BrowserContext::theSelectBoxShouldContain PHP Метод

theSelectBoxShouldContain() публичный Метод

Checks, that given select box contains the specified option
public theSelectBoxShouldContain ( $select, $option )
    public function theSelectBoxShouldContain($select, $option)
    {
        $select = str_replace('\\"', '"', $select);
        $option = str_replace('\\"', '"', $option);
        $obj = $this->getSession()->getPage()->findField($select);
        if ($obj === null) {
            throw new ElementNotFoundException($this->getSession(), 'select box', 'id|name|label|value', $select);
        }
        $optionText = $obj->getText();
        $message = "The '{$select}' select box does not contain the '{$option}' option";
        $this->assertContains($option, $optionText, $message);
    }