public function select($selectSelector, $optionSelector) { $selectElement = parent::select($this->byQuery($selectSelector)); if (preg_match('/label=(.+)/', $optionSelector, $match)) { $selectElement->selectOptionByLabel($match[1]); } else { if (preg_match('/value=(.+)/', $optionSelector, $match)) { $selectElement->selectOptionByValue($match[1]); } else { throw new \Exception("Unknown option selector '{$optionSelector}'"); } } }
protected function assertSelectedValue($id, $index) { $this->assertSame($index, parent::select($this->getElement($id))->selectedValue()); }