function ComposerIntegrationTest::providerBinDir

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/Composer/ComposerIntegrationTest.php \Drupal\Tests\Composer\ComposerIntegrationTest::providerBinDir()

Data provider for testBinDir().

File

core/tests/Drupal/Tests/Composer/ComposerIntegrationTest.php, line 86

Class

ComposerIntegrationTest
Tests Composer integration.

Namespace

Drupal\Tests\Composer

Code

public static function providerBinDir() : array {
  return [
    'no composer.json' => [
      NULL,
      'vendor/bin',
    ],
    'no config section' => [
      [
        'name' => 'test/project',
      ],
      'vendor/bin',
    ],
    'empty config section' => [
      [
        'config' => [],
      ],
      'vendor/bin',
    ],
    'bin-dir set' => [
      [
        'config' => [
          'bin-dir' => 'tools',
        ],
      ],
      'tools',
    ],
    'bin-dir nested' => [
      [
        'config' => [
          'bin-dir' => 'build/bin',
        ],
      ],
      'build/bin',
    ],
    'vendor-dir set without bin-dir' => [
      [
        'config' => [
          'vendor-dir' => 'deps',
        ],
      ],
      'deps/bin',
    ],
    'bin-dir wins over vendor-dir' => [
      [
        'config' => [
          'vendor-dir' => 'deps',
          'bin-dir' => 'tools',
        ],
      ],
      'tools',
    ],
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.