function TestBaseTest::invokeProtectedMethod

Invoke methods that are protected or private.

Parameters

object $object: Object on which to invoke the method.

string $method_name: Name of the method to invoke.

array $arguments: Array of arguments to be passed to the method.

Return value

mixed Value returned by the invoked method.

14 calls to TestBaseTest::invokeProtectedMethod()
TestBaseTest::testAssertEqual in core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@covers ::assertEqual @dataProvider providerEqualityAssertions
TestBaseTest::testAssertFalse in core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@covers ::assertFalse @dataProvider providerAssertTrue
TestBaseTest::testAssertIdentical in core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@covers ::assertIdentical @dataProvider providerEqualityAssertions
TestBaseTest::testAssertIdenticalObject in core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@covers ::assertIdenticalObject @dataProvider providerAssertIdenticalObject
TestBaseTest::testAssertNotEqual in core/modules/simpletest/tests/src/Unit/TestBaseTest.php
@covers ::assertNotEqual @dataProvider providerEqualityAssertions

... See full list

File

core/modules/simpletest/tests/src/Unit/TestBaseTest.php, line 52

Class

TestBaseTest
@requires extension curl @coversDefaultClass \Drupal\simpletest\TestBase @group simpletest @group TestBase

Namespace

Drupal\Tests\simpletest\Unit

Code

public function invokeProtectedMethod($object, $method_name, array $arguments) {
    $ref_method = new \ReflectionMethod($object, $method_name);
    $ref_method->setAccessible(TRUE);
    return $ref_method->invokeArgs($object, $arguments);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.