You are here

private function BestPracticesTest::assertImplementMethod in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php \Behat\Mink\Tests\Driver\Basic\BestPracticesTest::assertImplementMethod()
2 calls to BestPracticesTest::assertImplementMethod()
BestPracticesTest::testImplementBasicApi in vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php
@dataProvider provideRequiredMethods
BestPracticesTest::testImplementFindXpath in vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php
@depends testExtendsCoreDriver

File

vendor/behat/mink/driver-testsuite/tests/Basic/BestPracticesTest.php, line 57

Class

BestPracticesTest
This testcase ensures that the driver implementation follows recommended practices for drivers.

Namespace

Behat\Mink\Tests\Driver\Basic

Code

private function assertImplementMethod($method, $object, $reason = '') {
  $ref = new \ReflectionClass(get_class($object));
  $refMethod = $ref
    ->getMethod($method);
  $message = sprintf('The driver should implement the `%s` method.', $method);
  if ('' !== $reason) {
    $message .= ' ' . $reason;
  }
  $this
    ->assertSame($ref->name, $refMethod
    ->getDeclaringClass()->name, $message);
}