function ComposerDeprecationTest::testEnsureHtaccess

@covers ::ensureHtaccess @group legacy

File

core/tests/Drupal/Tests/Core/Composer/ComposerDeprecationTest.php, line 27

Class

ComposerDeprecationTest
Tests the deprecations in the <a href="/api/drupal/core%21lib%21Drupal%21Core%21Composer%21Composer.php/class/Composer/9" title="Provides static functions for composer script events." class="local">Drupal\Core\Composer\Composer</a> class.

Namespace

Drupal\Tests\Core\Composer

Code

public function testEnsureHtaccess() {
    $event = $this->prophesize(Event::class);
    $composer = $this->prophesize(ComposerClass::class);
    $event->getComposer()
        ->willReturn($composer->reveal());
    $config = $this->prophesize(Config::class);
    $composer->getConfig()
        ->willReturn($config->reveal());
    $this->expectDeprecation('Unsilenced deprecation: Calling Drupal\\Core\\Composer\\Composer::ensureHtaccess from composer.json is deprecated in drupal:9.5.0 and is removed from drupal:10.0.0. Any "scripts" section mentioning this in composer.json can be removed and replaced with the drupal/core-vendor-hardening Composer plugin, as needed. See https://www.drupal.org/node/3260624');
    Composer::ensureHtaccess($event->reveal());
}

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