You are here

public function WardenManagerTest::testGenerateDataTwoModules 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::testGenerateDataTwoModules()
  2. 3.x tests/src/Unit/Service/WardenManagerTest.php \Drupal\Tests\warden\Unit\Service\WardenManagerTest::testGenerateDataTwoModules()

Tests generating module data with two modules.

File

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

Class

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

Namespace

Drupal\Tests\warden\Unit\Service

Code

public function testGenerateDataTwoModules() {
  $expected_data = [
    'core' => [
      'drupal' => [
        'version' => \Drupal::VERSION,
      ],
    ],
    'contrib' => [
      'module_a' => [
        'version' => '8.x-1.0',
      ],
      'module_b' => [
        'version' => '8.x-1.0',
      ],
    ],
    'custom' => [],
    'url' => 'http://www.example.com',
    'site_name' => 'My Website',
    'key' => $this->token,
    'time' => 12345678,
  ];
  $this->wardenManager
    ->setModules([
    'module_a' => $this
      ->getMockExtension('module_a'),
    'module_b' => $this
      ->getMockExtension('module_b'),
  ]);
  $this
    ->expectContribModules([
    'module_a',
    'module_b',
  ]);
  $actual_data = $this->wardenManager
    ->generateSiteData();
  $this
    ->assertEquals($expected_data, $actual_data);
}