protected function setUp() { if (is_null($this->collectionClass)) { $this->collectionClass = '\\tests\\QATools\\QATools\\HtmlElements\\Fixture\\Element\\TypifiedElementCollectionChild'; $this->collectionElementClass = '\\QATools\\QATools\\HtmlElements\\Element\\TextInput'; } $this->webElement = m::mock(self::WEB_ELEMENT_CLASS); $this->webElement->shouldReceive('getSession')->withNoArgs()->andReturn($this->session); parent::setUp(); }
public function testToString() { $element = $this->createElement(); $this->webElement->shouldReceive('getXpath')->andReturn('XPATH'); $expected = 'element (class: ' . get_class($element) . '; xpath: XPATH)'; $this->assertEquals($expected, (string) $element); }
/** * Mocks getAttribute in the web element. * * @param array $attributes Mocked attributes. * * @return void */ protected function expectWebElementGetAttribute(array $attributes) { foreach ($attributes as $attribute => $value) { $this->webElement->shouldReceive('getAttribute')->with($attribute)->andReturn($value)->byDefault(); } }