You are here

public function LocalTest::testHtaccessNotOverwritten in Flysystem 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/Flysystem/LocalTest.php \Drupal\Tests\flysystem\Unit\Flysystem\LocalTest::testHtaccessNotOverwritten()
  2. 3.x tests/src/Unit/Flysystem/LocalTest.php \Drupal\Tests\flysystem\Unit\Flysystem\LocalTest::testHtaccessNotOverwritten()
  3. 3.0.x tests/src/Unit/Flysystem/LocalTest.php \Drupal\Tests\flysystem\Unit\Flysystem\LocalTest::testHtaccessNotOverwritten()

@covers ::ensure @covers ::writeHtaccess

File

tests/src/Unit/Flysystem/LocalTest.php, line 116

Class

LocalTest
@coversDefaultClass \Drupal\flysystem\Flysystem\Local @group flysystem

Namespace

Drupal\Tests\flysystem\Unit\Flysystem

Code

public function testHtaccessNotOverwritten() {
  file_put_contents('foo/bar/.htaccess', 'htcontent');
  $result = (new Local('foo/bar'))
    ->ensure();
  $this
    ->assertSame(1, count($result));
  $this
    ->assertSame(RfcLogLevel::INFO, $result[0]['severity']);
  $this
    ->assertSame('htcontent', file_get_contents('foo/bar/.htaccess'));
}