diff --git a/tests/Driver/CoreDriverTest.php b/tests/Driver/CoreDriverTest.php index 9978d04ab..0e08b5680 100644 --- a/tests/Driver/CoreDriverTest.php +++ b/tests/Driver/CoreDriverTest.php @@ -22,9 +22,15 @@ public function testNoExtraMethods() public function testCreateNodeElements() { + if(\PHPUnit\Runner\Version::id() >= 10) { + $driver = $this->getMockBuilder('Behat\Mink\Driver\CoreDriver') + ->onlyMethods(array('findElementXpaths')) + ->getMockForAbstractClass(); + } else { $driver = $this->getMockBuilder('Behat\Mink\Driver\CoreDriver') ->setMethods(array('findElementXpaths')) ->getMockForAbstractClass(); + } $session = $this->getMockBuilder('Behat\Mink\Session') ->disableOriginalConstructor() @@ -74,7 +80,7 @@ public function testInterfaceMethods(\ReflectionMethod $method) $coreDriverMethod->invokeArgs($driver, $this->getArguments($method)); } - public function getDriverInterfaceMethods() + public static function getDriverInterfaceMethods() { $ref = new \ReflectionClass('Behat\Mink\Driver\DriverInterface'); diff --git a/tests/Element/DocumentElementTest.php b/tests/Element/DocumentElementTest.php index 18b245022..cca3e295e 100644 --- a/tests/Element/DocumentElementTest.php +++ b/tests/Element/DocumentElementTest.php @@ -5,7 +5,7 @@ use Behat\Mink\Element\DocumentElement; use Behat\Mink\Element\NodeElement; -class DocumentElementTest extends ElementTest +class DocumentElementTest extends ElementTestCase { /** * Page. diff --git a/tests/Element/ElementTest.php b/tests/Element/ElementTestCase.php similarity index 95% rename from tests/Element/ElementTest.php rename to tests/Element/ElementTestCase.php index 1b8e521d1..15a3b8131 100644 --- a/tests/Element/ElementTest.php +++ b/tests/Element/ElementTestCase.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -abstract class ElementTest extends TestCase +abstract class ElementTestCase extends TestCase { /** * Session. diff --git a/tests/Element/NodeElementTest.php b/tests/Element/NodeElementTest.php index a0b2c9487..be354af85 100644 --- a/tests/Element/NodeElementTest.php +++ b/tests/Element/NodeElementTest.php @@ -5,7 +5,7 @@ use Behat\Mink\Element\NodeElement; use Behat\Mink\Exception\DriverException; -class NodeElementTest extends ElementTest +class NodeElementTest extends ElementTestCase { public function testGetXpath() { diff --git a/tests/Exception/ElementNotFoundExceptionTest.php b/tests/Exception/ElementNotFoundExceptionTest.php index fd6cbbd00..2ab2d7249 100644 --- a/tests/Exception/ElementNotFoundExceptionTest.php +++ b/tests/Exception/ElementNotFoundExceptionTest.php @@ -19,7 +19,7 @@ public function testBuildMessage(string $message, ?string $type, ?string $select $this->assertEquals($message, $exception->getMessage()); } - public function provideExceptionMessage() + public static function provideExceptionMessage() { return array( array('Tag not found.', null), diff --git a/tests/Selector/ExactNamedSelectorTest.php b/tests/Selector/ExactNamedSelectorTest.php index df51f0fd7..eee0dfff8 100644 --- a/tests/Selector/ExactNamedSelectorTest.php +++ b/tests/Selector/ExactNamedSelectorTest.php @@ -4,7 +4,7 @@ use Behat\Mink\Selector\ExactNamedSelector; -class ExactNamedSelectorTest extends NamedSelectorTest +class ExactNamedSelectorTest extends NamedSelectorTestCase { protected function getSelector() { diff --git a/tests/Selector/NamedSelectorTest.php b/tests/Selector/NamedSelectorTestCase.php similarity index 99% rename from tests/Selector/NamedSelectorTest.php rename to tests/Selector/NamedSelectorTestCase.php index 2ef382978..a79c94af7 100644 --- a/tests/Selector/NamedSelectorTest.php +++ b/tests/Selector/NamedSelectorTestCase.php @@ -6,7 +6,7 @@ use Behat\Mink\Selector\Xpath\Escaper; use PHPUnit\Framework\TestCase; -abstract class NamedSelectorTest extends TestCase +abstract class NamedSelectorTestCase extends TestCase { public function testRegisterXpath() { @@ -105,7 +105,7 @@ public function testEscapedSelectors(string $fixtureFile, string $selector, stri $this->testSelectors($fixtureFile, $selector, $locator, $expectedExactCount, $expectedPartialCount); } - public function getSelectorTests() + public static function getSelectorTests() { $fieldCount = 8; // fields without `type` attribute $fieldCount += 4; // fields with `type=checkbox` attribute @@ -196,7 +196,7 @@ public function getSelectorTests() ); } - public function getLateRegisteredReplacements() + public static function getLateRegisteredReplacements() { // The following tests all use `test.html` from the fixtures directory. return array( diff --git a/tests/Selector/PartialNamedSelectorTest.php b/tests/Selector/PartialNamedSelectorTest.php index c3e631a11..53b3c39ad 100644 --- a/tests/Selector/PartialNamedSelectorTest.php +++ b/tests/Selector/PartialNamedSelectorTest.php @@ -4,7 +4,7 @@ use Behat\Mink\Selector\PartialNamedSelector; -class PartialNamedSelectorTest extends NamedSelectorTest +class PartialNamedSelectorTest extends NamedSelectorTestCase { protected function getSelector() { diff --git a/tests/Selector/Xpath/EscaperTest.php b/tests/Selector/Xpath/EscaperTest.php index 530dbe2f5..3f2617914 100644 --- a/tests/Selector/Xpath/EscaperTest.php +++ b/tests/Selector/Xpath/EscaperTest.php @@ -17,7 +17,7 @@ public function testXpathLiteral(string $string, string $expected) $this->assertEquals($expected, $escaper->escapeLiteral($string)); } - public function getXpathLiterals() + public static function getXpathLiterals() { return array( array('some simple string', "'some simple string'"), diff --git a/tests/Selector/Xpath/ManipulatorTest.php b/tests/Selector/Xpath/ManipulatorTest.php index 2c2a76094..aef44292c 100644 --- a/tests/Selector/Xpath/ManipulatorTest.php +++ b/tests/Selector/Xpath/ManipulatorTest.php @@ -17,7 +17,7 @@ public function testPrepend(string $prefix, string $xpath, string $expectedXpath $this->assertEquals($expectedXpath, $manipulator->prepend($xpath, $prefix)); } - public function getPrependedXpath() + public static function getPrependedXpath() { return array( 'simple' => array( diff --git a/tests/SessionTest.php b/tests/SessionTest.php index e1ecc4665..f97f03472 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -186,7 +186,7 @@ public function testGetResponseHeader(?string $expected, string $name, array $he $this->assertSame($expected, $this->session->getResponseHeader($name)); } - public function provideResponseHeader() + public static function provideResponseHeader() { return array( array('test', 'Mink', array('Mink' => 'test')), diff --git a/tests/WebAssertTest.php b/tests/WebAssertTest.php index b6145e5ef..9011bc502 100644 --- a/tests/WebAssertTest.php +++ b/tests/WebAssertTest.php @@ -922,7 +922,7 @@ function () use ($selector, $locator) { ); } - public function getArrayLocatorFormats() + public static function getArrayLocatorFormats() { return array( 'named' => array(