-
Notifications
You must be signed in to change notification settings - Fork 279
/
Copy pathElementTestCase.php
42 lines (35 loc) · 997 Bytes
/
ElementTestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Behat\Mink\Tests\Element;
use Behat\Mink\Driver\DriverInterface;
use Behat\Mink\Element\ElementFinder;
use Behat\Mink\Session;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
abstract class ElementTestCase extends TestCase
{
/**
* Session.
*
* @var Session
*/
protected $session;
/**
* @var DriverInterface&MockObject
*/
protected $driver;
/**
* @var ElementFinder&MockObject
*/
protected $elementFinder;
/**
* @before
*/
protected function prepareSession(): void
{
$this->driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock();
$this->elementFinder = $this->createMock(ElementFinder::class);
$this->session = $this->createStub(Session::class);
$this->session->method('getDriver')->willReturn($this->driver);
$this->session->method('getElementFinder')->willReturn($this->elementFinder);
}
}