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
42
vendor/behat/mink/tests/Exception/ElementExceptionTest.php
vendored
Normal file
42
vendor/behat/mink/tests/Exception/ElementExceptionTest.php
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace Behat\Mink\Tests\Exception;
|
||||
|
||||
use Behat\Mink\Exception\ElementException;
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
class ElementExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testMessage()
|
||||
{
|
||||
$exception = new ElementException($this->getElementMock(), new \Exception('Something went wrong'));
|
||||
|
||||
$expectedMessage = "Exception thrown by element XPath\nSomething went wrong";
|
||||
$this->assertEquals($expectedMessage, $exception->getMessage());
|
||||
$this->assertEquals($expectedMessage, (string) $exception);
|
||||
}
|
||||
|
||||
public function testElement()
|
||||
{
|
||||
$element = $this->getElementMock();
|
||||
|
||||
$exception = new ElementException($element, new \Exception('Something went wrong'));
|
||||
|
||||
$this->assertSame($element, $exception->getElement());
|
||||
}
|
||||
|
||||
private function getElementMock()
|
||||
{
|
||||
$mock = $this->getMockBuilder('Behat\Mink\Element\Element')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('getXPath')
|
||||
->will($this->returnValue('element XPath'));
|
||||
|
||||
return $mock;
|
||||
}
|
||||
}
|
Reference in a new issue