Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
84
vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php
vendored
Normal file
84
vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
namespace Behat\Mink\Tests\Driver\Form;
|
||||
|
||||
use Behat\Mink\Tests\Driver\TestCase;
|
||||
|
||||
class RadioTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
$this->getSession()->visit($this->pathTo('radio.html'));
|
||||
}
|
||||
|
||||
public function testIsChecked()
|
||||
{
|
||||
$option = $this->findById('first');
|
||||
$option2 = $this->findById('second');
|
||||
|
||||
$this->assertTrue($option->isChecked());
|
||||
$this->assertFalse($option2->isChecked());
|
||||
|
||||
$option2->selectOption('updated');
|
||||
|
||||
$this->assertFalse($option->isChecked());
|
||||
$this->assertTrue($option2->isChecked());
|
||||
}
|
||||
|
||||
public function testSelectOption()
|
||||
{
|
||||
$option = $this->findById('first');
|
||||
|
||||
$this->assertEquals('set', $option->getValue());
|
||||
|
||||
$option->selectOption('updated');
|
||||
|
||||
$this->assertEquals('updated', $option->getValue());
|
||||
|
||||
$option->selectOption('set');
|
||||
|
||||
$this->assertEquals('set', $option->getValue());
|
||||
}
|
||||
|
||||
public function testSetValue()
|
||||
{
|
||||
$option = $this->findById('first');
|
||||
|
||||
$this->assertEquals('set', $option->getValue());
|
||||
|
||||
$option->setValue('updated');
|
||||
|
||||
$this->assertEquals('updated', $option->getValue());
|
||||
$this->assertFalse($option->isChecked());
|
||||
}
|
||||
|
||||
public function testSameNameInMultipleForms()
|
||||
{
|
||||
$option1 = $this->findById('reused_form1');
|
||||
$option2 = $this->findById('reused_form2');
|
||||
|
||||
$this->assertEquals('test2', $option1->getValue());
|
||||
$this->assertEquals('test3', $option2->getValue());
|
||||
|
||||
$option1->selectOption('test');
|
||||
|
||||
$this->assertEquals('test', $option1->getValue());
|
||||
$this->assertEquals('test3', $option2->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/Behat/MinkSahiDriver/issues/32
|
||||
*/
|
||||
public function testSetValueXPathEscaping()
|
||||
{
|
||||
$session = $this->getSession();
|
||||
$session->visit($this->pathTo('/advanced_form.html'));
|
||||
$page = $session->getPage();
|
||||
|
||||
$sex = $page->find('xpath', '//*[@name = "sex"]'."\n|\n".'//*[@id = "sex"]');
|
||||
$this->assertNotNull($sex, 'xpath with line ending works');
|
||||
|
||||
$sex->setValue('m');
|
||||
$this->assertEquals('m', $sex->getValue(), 'no double xpath escaping during radio button value change');
|
||||
}
|
||||
}
|
Reference in a new issue