Example #1
0
 /**
  * @covers ::setValue
  * @covers ::unselectAll
  */
 public function testSetValue()
 {
     $domElement = $this->document->getElementById('country');
     $input = new Select($this->crawler, $domElement);
     $input->setValue('bulgaria');
     $this->assertSame('bulgaria', $input->getValue());
 }
Example #2
0
 /**
  * @covers ::select
  */
 public function testSelect()
 {
     $uk = $this->document->getElementById('uk');
     $bulgaria = $this->document->getElementById('bulgaria');
     $country = $this->document->getElementById('country');
     $optionUk = new Option($this->crawler, $uk);
     $optionBulgaria = new Option($this->crawler, $bulgaria);
     $select = new Select($this->crawler, $country);
     $this->assertSame('uk', $select->getValue());
     $optionBulgaria->select();
     $this->assertMatchesSelector('option:not([selected])', $uk);
     $this->assertMatchesSelector('option[selected]', $bulgaria);
     $this->assertSame('bulgaria', $select->getValue());
 }