@@ -63,8 +63,12 @@ protected function ensureDirectoryExistsAndClear($directory) {
63
63
}
64
64
65
65
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 );
68
72
$ this ->assertFileExists ($ this ->tmpDir . '/.htaccess ' );
69
73
$ this ->assertFileExists ($ this ->tmpDir . '/sites/default/default.settings.php ' );
70
74
}
@@ -73,10 +77,14 @@ public function testFetch() {
73
77
* Tests version specific files.
74
78
*/
75
79
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
+ ]);
77
85
78
86
$ this ->setExpectedException (TransportException::class);
79
- $ fetcher ->fetch ('8.2.x ' , $ this ->tmpDir );
87
+ $ fetcher ->fetch ('8.2.x ' , $ this ->tmpDir , true );
80
88
81
89
$ this ->assertFileExists ($ this ->tmpDir . '/.eslintrc ' );
82
90
$ this ->assertFileNotExists ($ this ->tmpDir . '/.eslintrc.json ' );
@@ -85,15 +93,18 @@ public function testFetchVersionSpecific() {
85
93
@unlink ($ this ->tmpDir . '/.eslintrc ' );
86
94
87
95
$ this ->setExpectedException (TransportException::class);
88
- $ fetcher ->fetch ('8.3.x ' , $ this ->tmpDir );
96
+ $ fetcher ->fetch ('8.3.x ' , $ this ->tmpDir , true );
89
97
90
98
$ this ->assertFileExists ($ this ->tmpDir . '/.eslintrc.json ' );
91
99
$ this ->assertFileNotExists ($ this ->tmpDir . '/.eslintrc ' );
92
100
}
93
101
94
102
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 );
97
108
$ this ->assertFileExists ($ this ->tmpDir . '/sites/default/settings.php ' );
98
109
}
99
110
}
0 commit comments