You are here

public function ProtectedPrivatesSubclass::subclassProtectedAdd in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 phpunit_example/tests/src/Unit/Subclasses/ProtectedPrivatesSubclass.php \Drupal\Tests\phpunit_example\Unit\Subclasses\ProtectedPrivatesSubclass::subclassProtectedAdd()

A stub class so we can access a protected method.

We use a naming convention to make it clear that we are using a shimmed method.

File

modules/phpunit_example/tests/src/Unit/Subclasses/ProtectedPrivatesSubclass.php, line 26

Class

ProtectedPrivatesSubclass
A class for testing ProtectedPrivate::protectedAdd().

Namespace

Drupal\Tests\phpunit_example\Unit\Subclasses

Code

public function subclassProtectedAdd($a, $b) {
  return $this
    ->protectedAdd($a, $b);
}