You are here

public function S3fsDrushTest::testDrushCopyLocalPrivateOnly in S3 File System 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/S3fsDrushTest.php \Drupal\Tests\s3fs\Functional\S3fsDrushTest::testDrushCopyLocalPrivateOnly()

Coverage test for the drush s3fs:copy-local --scheme=private.

File

tests/src/Functional/S3fsDrushTest.php, line 79

Class

S3fsDrushTest
S3 File System Tests.

Namespace

Drupal\Tests\s3fs\Functional

Code

public function testDrushCopyLocalPrivateOnly() {
  $this
    ->drush('s3fs:copy-local', [], [
    'scheme' => 'private',
  ]);
  $messages = $this
    ->getErrorOutput();
  $this
    ->assertStringContainsString('[notice] You are going to copy private scheme(s).', $messages, 'Successfully Refreshed Cache');
  $this
    ->assertStringContainsString('Including private scheme', $messages, "Uploading public as part of all");
  $this
    ->assertStringContainsString('Message: Copied local /private/ files to S3', $messages, "Uploading public as part of all");
  $records = $this->connection
    ->select('s3fs_file', 's')
    ->fields('s')
    ->condition('dir', 0, '=')
    ->condition('uri', '%' . $this->connection
    ->escapeLike('/drush/') . '%', 'LIKE')
    ->execute()
    ->fetchAll();
  $this
    ->assertEquals(2, count($records));
}