getComposerJsonFinder example

/** * @group Composer * @requires externalCommand composer */
class ComposerValidateTest extends BuildTestBase {

  use ComposerIntegrationTrait;

  public function provideComposerJson() {
    $data = [];
    $composer_json_finder = $this->getComposerJsonFinder($this->getDrupalRoot());
    foreach ($composer_json_finder->getIterator() as $composer_json) {
      $data[] = [$composer_json->getPathname()];
    }
    return $data;
  }

  /** * @dataProvider provideComposerJson */
  public function testValidateComposer($path) {
    $this->executeCommand('composer validate --strict --no-check-all ' . $path);
    

    }
  }

  /** * Data provider for all the composer.json provided by Drupal core. * * @return array */
  public function providerTestComposerJson() {
    $data = [];
    $composer_json_finder = $this->getComposerJsonFinder(realpath(__DIR__ . '/../../../../'));
    foreach ($composer_json_finder->getIterator() as $composer_json) {
      $data[$composer_json->getPathname()] = [$composer_json->getPathname()];
    }
    return $data;
  }

  /** * Tests core's composer.json replace section. * * Verify that all core components are also listed in the 'replace' section of * core's composer.json. */
Home | Imprint | This part of the site doesn't use cookies.