You are here

public function UnitTestBase::containerMockGetServiceCallback in Entity Construction Kit (ECK) 8

Callback for the get method on the mocked service container.

Parameters

string $service_id: The service identifier being called.

Return value

mixed A (mocked) service class if one has been set for the given service id or NULL.

File

tests/src/Unit/UnitTestBase.php, line 154

Class

UnitTestBase
Base class for unit tests.

Namespace

Drupal\Tests\eck\Unit

Code

public function containerMockGetServiceCallback($service_id) {
  if (isset($this->services[$service_id])) {
    return $this->services[$service_id];
  }
  return NULL;
}