You are here

public function PackageManagerTest::setUp in Composer Manager 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/PackageManagerTest.php, line 94

Class

PackageManagerTest
@coversDefaultClass \Drupal\composer_manager\PackageManager @group composer_manager

Namespace

Drupal\Tests\composer_manager\Unit

Code

public function setUp() {
  parent::setUp();
  $structure = [
    'vendor' => [
      'composer' => [
        'installed.json' => json_encode($this->packages['installed']),
      ],
    ],
    'core' => [
      'composer.json' => json_encode($this->packages['core']),
    ],
    'profiles' => [
      'commerce_kickstart' => [
        'commerce_kickstart.info.yml' => 'type: profile',
        'commerce_kickstart.profile' => '<?php',
        'composer.json' => json_encode($this->packages['extension']['commerce_kickstart']),
      ],
    ],
    'modules' => [
      'test1' => [
        'composer.json' => json_encode($this->packages['extension']['test1']),
        'test1.module' => '<?php',
        'test1.info.yml' => 'type: module',
      ],
    ],
    'sites' => [
      'all' => [
        'modules' => [
          'test2' => [
            'composer.json' => json_encode($this->packages['extension']['test2']),
            'test2.module' => '<?php',
            'test2.info.yml' => 'type: module',
          ],
        ],
      ],
    ],
  ];
  vfsStream::setup('drupal', null, $structure);
  $this->manager = new PackageManager('vfs://drupal');
}