ComposerValidateTest.php

Same filename and directory in other branches
  1. 9 core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php
  2. 8.9.x core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php
  3. 10 core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php

Namespace

Drupal\BuildTests\Composer

File

core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\BuildTests\Composer;

use Drupal\BuildTests\Framework\BuildTestBase;
use Drupal\Tests\Composer\ComposerIntegrationTrait;

/**
 * @group Composer
 */
class ComposerValidateTest extends BuildTestBase {
    use ComposerIntegrationTrait;
    public static function provideComposerJson() {
        $data = [];
        $composer_json_finder = self::getComposerJsonFinder(self::getDrupalRootStatic());
        foreach ($composer_json_finder->getIterator() as $composer_json) {
            $data[] = [
                $composer_json->getPathname(),
            ];
        }
        return $data;
    }
    
    /**
     * @dataProvider provideComposerJson
     */
    public function testValidateComposer($path) : void {
        $this->executeCommand('composer validate --strict --no-check-all ' . $path);
        $this->assertCommandSuccessful();
    }

}

Classes

Title Deprecated Summary
ComposerValidateTest @group Composer

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