@@ -63,8 +63,12 @@ protected function ensureDirectoryExistsAndClear($directory) {
6363 }
6464
6565 public function testFetch () {
66- $ fetcher = new FileFetcher (new RemoteFilesystem (new NullIO ()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version} ' , ['.htaccess ' , 'sites/default/default.settings.php ' ], new NullIO ());
67- $ fetcher ->fetch ('8.1.1 ' , $ this ->tmpDir );
66+ $ fetcher = new FileFetcher (new RemoteFilesystem (new NullIO ()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version} ' , new NullIO ());
67+ $ fetcher ->setFilenames ([
68+ '.htaccess ' => '.htaccess ' ,
69+ 'sites/default/default.settings.php ' => 'sites/default/default.settings.php ' ,
70+ ]);
71+ $ fetcher ->fetch ('8.1.1 ' , $ this ->tmpDir , true );
6872 $ this ->assertFileExists ($ this ->tmpDir . '/.htaccess ' );
6973 $ this ->assertFileExists ($ this ->tmpDir . '/sites/default/default.settings.php ' );
7074 }
@@ -73,10 +77,14 @@ public function testFetch() {
7377 * Tests version specific files.
7478 */
7579 public function testFetchVersionSpecific () {
76- $ fetcher = new FileFetcher (new RemoteFilesystem (new NullIO ()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version} ' , ['.eslintrc ' , '.eslintrc.json ' ], new NullIO ());
80+ $ fetcher = new FileFetcher (new RemoteFilesystem (new NullIO ()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version} ' , new NullIO ());
81+ $ fetcher ->setFilenames ([
82+ '.eslintrc ' => '.eslintrc ' ,
83+ '.eslintrc.json ' => '.eslintrc.json ' ,
84+ ]);
7785
7886 $ this ->setExpectedException (TransportException::class);
79- $ fetcher ->fetch ('8.2.x ' , $ this ->tmpDir );
87+ $ fetcher ->fetch ('8.2.x ' , $ this ->tmpDir , true );
8088
8189 $ this ->assertFileExists ($ this ->tmpDir . '/.eslintrc ' );
8290 $ this ->assertFileNotExists ($ this ->tmpDir . '/.eslintrc.json ' );
@@ -85,15 +93,18 @@ public function testFetchVersionSpecific() {
8593 @unlink ($ this ->tmpDir . '/.eslintrc ' );
8694
8795 $ this ->setExpectedException (TransportException::class);
88- $ fetcher ->fetch ('8.3.x ' , $ this ->tmpDir );
96+ $ fetcher ->fetch ('8.3.x ' , $ this ->tmpDir , true );
8997
9098 $ this ->assertFileExists ($ this ->tmpDir . '/.eslintrc.json ' );
9199 $ this ->assertFileNotExists ($ this ->tmpDir . '/.eslintrc ' );
92100 }
93101
94102 public function testInitialFetch () {
95- $ fetcher = new InitialFileFetcher (new RemoteFilesystem (new NullIO ()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version} ' , ['sites/default/default.settings.php ' => 'sites/default/settings.php ' ], new NullIO ());
96- $ fetcher ->fetch ('8.1.1 ' , $ this ->tmpDir );
103+ $ fetcher = new FileFetcher (new RemoteFilesystem (new NullIO ()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version} ' , new NullIO ());
104+ $ fetcher ->setFilenames ([
105+ 'sites/default/default.settings.php ' => 'sites/default/settings.php ' ,
106+ ]);
107+ $ fetcher ->fetch ('8.1.1 ' , $ this ->tmpDir , false );
97108 $ this ->assertFileExists ($ this ->tmpDir . '/sites/default/settings.php ' );
98109 }
99110}
0 commit comments