public function S3fsDrushTest::testDrushCopyLocalBoth 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::testDrushCopyLocalBoth()
Coverage test for the drush s3fs:copy-local --scheme=all.
File
- tests/
src/ Functional/ S3fsDrushTest.php, line 99
Class
- S3fsDrushTest
- S3 File System Tests.
Namespace
Drupal\Tests\s3fs\FunctionalCode
public function testDrushCopyLocalBoth() {
// $this->markTestSkipped('Drush is currently stalling on this');
$this
->drush('s3fs:copy-local');
$messages = $this
->getErrorOutput();
$this
->assertStringContainsString('[notice] You are going to copy all scheme(s).', $messages, 'Including all schemes');
$this
->assertStringContainsString('Including public scheme', $messages, "Including public as part of all");
$this
->assertStringContainsString('Including private scheme', $messages, "Including private as part of all");
$this
->assertStringContainsString('Message: Copied local /public/ files to S3', $messages, "Uploaded public as part of all");
$this
->assertStringContainsString('Message: Copied local /private/ files to S3', $messages, "Uploaded private 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(4, count($records));
}