ComposerValidateTest.php 810 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Drupal\BuildTests\Composer;
  3. use Drupal\BuildTests\Framework\BuildTestBase;
  4. use Drupal\Tests\Composer\ComposerIntegrationTrait;
  5. /**
  6. * @group Composer
  7. * @requires externalCommand composer
  8. */
  9. class ComposerValidateTest extends BuildTestBase {
  10. use ComposerIntegrationTrait;
  11. public function provideComposerJson() {
  12. $data = [];
  13. $composer_json_finder = $this->getComposerJsonFinder($this->getDrupalRoot());
  14. foreach ($composer_json_finder->getIterator() as $composer_json) {
  15. $data[] = [$composer_json->getPathname()];
  16. }
  17. return $data;
  18. }
  19. /**
  20. * @dataProvider provideComposerJson
  21. */
  22. public function testValidateComposer($path) {
  23. $this->executeCommand('composer validate --strict --no-check-all ' . $path);
  24. $this->assertCommandSuccessful();
  25. }
  26. }