public function S3fsDrushTest::testDrushCopyLocalPublicOnly in S3 File System 4.0.x
Same name and namespace in other branches
- 8.3 tests/src/Functional/S3fsDrushTest.php \Drupal\Tests\s3fs\Functional\S3fsDrushTest::testDrushCopyLocalPublicOnly()
Coverage test for the drush s3fs:copy-local --scheme=public.
File
- tests/
src/ Functional/ S3fsDrushTest.php, line 59
Class
- S3fsDrushTest
- S3 File System Tests.
Namespace
Drupal\Tests\s3fs\FunctionalCode
public function testDrushCopyLocalPublicOnly() {
$this
->drush('s3fs:copy-local', [], [
'scheme' => 'public',
]);
$messages = $this
->getErrorOutput();
$this
->assertStringContainsString('[notice] You are going to copy public scheme(s).', $messages, 'Successfully Refreshed Cache');
$this
->assertStringContainsString('Including public scheme', $messages, "Uploading public as part of all");
$this
->assertStringContainsString('Message: Copied local /public/ 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));
}