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
41
vendor/behat/mink/tests/Selector/CssSelectorTest.php
vendored
Normal file
41
vendor/behat/mink/tests/Selector/CssSelectorTest.php
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace Behat\Mink\Tests\Selector;
|
||||
|
||||
use Behat\Mink\Selector\CssSelector;
|
||||
|
||||
class CssSelectorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
|
||||
$this->markTestSkipped('Symfony2 CssSelector component not installed');
|
||||
}
|
||||
}
|
||||
|
||||
public function testSelector()
|
||||
{
|
||||
$selector = new CssSelector();
|
||||
|
||||
$this->assertEquals('descendant-or-self::h3', $selector->translateToXPath('h3'));
|
||||
$this->assertEquals('descendant-or-self::h3/span', $selector->translateToXPath('h3 > span'));
|
||||
|
||||
if (interface_exists('Symfony\Component\CssSelector\XPath\TranslatorInterface')) {
|
||||
// The rewritten component of Symfony 2.3 checks for attribute existence first for the class.
|
||||
$expectation = "descendant-or-self::h3/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]";
|
||||
} else {
|
||||
$expectation = "descendant-or-self::h3/*[contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]";
|
||||
}
|
||||
$this->assertEquals($expectation, $selector->translateToXPath('h3 > .my_div'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testThrowsForArrayLocator()
|
||||
{
|
||||
$selector = new CssSelector();
|
||||
|
||||
$selector->translateToXPath(array('h3'));
|
||||
}
|
||||
}
|
Reference in a new issue