Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -0,0 +1,48 @@
<?php
namespace Behat\Mink\Tests\Exception;
use Behat\Mink\Exception\ElementTextException;
class ElementTextExceptionTest extends \PHPUnit_Framework_TestCase
{
public function testExceptionToString()
{
$driver = $this->getMock('Behat\Mink\Driver\DriverInterface');
$element = $this->getElementMock();
$driver->expects($this->any())
->method('getStatusCode')
->will($this->returnValue(200));
$driver->expects($this->any())
->method('getCurrentUrl')
->will($this->returnValue('http://localhost/test'));
$element->expects($this->any())
->method('getText')
->will($this->returnValue("Hello world\nTest\n"));
$expected = <<<'TXT'
Text error
+--[ HTTP/1.1 200 | http://localhost/test | %s ]
|
| Hello world
| Test
|
TXT;
$expected = sprintf($expected.' ', get_class($driver));
$exception = new ElementTextException('Text error', $driver, $element);
$this->assertEquals($expected, $exception->__toString());
}
private function getElementMock()
{
return $this->getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
}
}