/** * @dataProvider selectDeselectDataProvider */ public function testSelect($checked) { $this->webElement->shouldReceive('isSelected')->once()->andReturn($checked); $this->webElement->shouldReceive('getAttribute')->with('value')->andReturn('OK'); $web_element = m::mock(self::WEB_ELEMENT_CLASS); $web_element->shouldReceive('selectOption')->with('OK', true)->times($checked ? 0 : 1); $this->select->shouldReceive('getWrappedElement')->andReturn($web_element); $element = $this->getElement(); $this->assertSame($element, $element->select(true)); }