You are here

protected function WardenManagerTest::getMockExtension in Warden 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/Service/WardenManagerTest.php \Drupal\Tests\warden\Unit\Service\WardenManagerTest::getMockExtension()
  2. 3.x tests/src/Unit/Service/WardenManagerTest.php \Drupal\Tests\warden\Unit\Service\WardenManagerTest::getMockExtension()

Parameters

string $name:

string $type:

Return value

Extension|\PHPUnit_Framework_MockObject_MockObject

2 calls to WardenManagerTest::getMockExtension()
WardenManagerTest::testGenerateDataOneModule in tests/src/Unit/Service/WardenManagerTest.php
Tests generating module data with one module.
WardenManagerTest::testGenerateDataTwoModules in tests/src/Unit/Service/WardenManagerTest.php
Tests generating module data with two modules.

File

tests/src/Unit/Service/WardenManagerTest.php, line 106

Class

WardenManagerTest
@coversDefaultClass \Drupal\warden\Service\WardenManager @group warden

Namespace

Drupal\Tests\warden\Unit\Service

Code

protected function getMockExtension($name, $type = 'contrib') {

  /** @var Extension|\PHPUnit_Framework_MockObject_MockObject $module_b */
  $extension = $this
    ->getMock('Drupal\\Core\\Extension\\Extension', array(), array(), '', FALSE);
  $extension
    ->expects($this
    ->once())
    ->method('getPathname')
    ->willReturn("modules/{$type}/{$name}/{$name}.info.yml");
  return $extension;
}