File tree Expand file tree Collapse file tree 4 files changed +28
-5
lines changed Expand file tree Collapse file tree 4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,19 @@ public function it_can_run_successfully(): void
51
51
$ this ->release ->extract ();
52
52
53
53
$ updateExecutor = (new UpdateExecutor ())->setBasePath ($ dir );
54
- $ this ->assertTrue ($ updateExecutor ->run ($ this ->release ));
55
54
55
+ $ this ->assertTrue ($ updateExecutor ->run ($ this ->release ));
56
+ $ this ->assertTrue (File::exists ($ dir . '/.some-hidden-file ' ));
57
+ $ this ->assertTrue (File::exists ($ dir . '/outer-file.txt ' ));
58
+ $ this ->assertTrue (File::exists ($ dir . '/folder1 ' ));
59
+ $ this ->assertEmpty (File::allFiles ($ dir . '/folder1 ' ));
60
+ $ this ->assertTrue (File::exists ($ dir . '/folder2 ' ));
61
+ $ this ->assertTrue (File::exists ($ dir . '/folder2/samplefile-in-folder2.txt ' ));
62
+ $ this ->assertEquals (1 , count (File::allFiles ($ dir . '/folder2 ' )));
63
+ $ this ->assertFalse (File::exists ($ dir . '/node_modules ' ));
64
+ $ this ->assertFalse (File::exists ($ dir . '/__MACOSX ' ));
65
+ $ this ->assertFalse (File::exists ($ dir . '/release-1.2 ' ));
66
+ $ this ->assertFalse (File::exists ($ dir . '/release-1.2.zip ' ));
56
67
}
57
68
58
69
/** @test */
Original file line number Diff line number Diff line change 16
16
17
17
class GithubRepositoryTypeTest extends TestCase
18
18
{
19
+ protected function setUp (): void
20
+ {
21
+ parent ::setUp ();
22
+ $ this ->resetDownloadDir ();
23
+ }
24
+
19
25
/** @test */
20
26
public function it_can_instantiate (): void
21
27
{
@@ -55,7 +61,7 @@ public function it_can_run_update(): void
55
61
56
62
/** @var Release $release */
57
63
$ release = resolve (Release::class);
58
- $ release ->setStoragePath (' /tmp ' )
64
+ $ release ->setStoragePath (( string ) config ( ' self-update.repository_types.github.download_path ' ) )
59
65
->setVersion ('1.0 ' )
60
66
->setRelease ('release-1.0.zip ' )
61
67
->updateStoragePath ()
Original file line number Diff line number Diff line change 10
10
11
11
class HttpRepositoryTypeTest extends TestCase
12
12
{
13
+ protected function setUp (): void
14
+ {
15
+ parent ::setUp ();
16
+ $ this ->resetDownloadDir ();
17
+ }
18
+
13
19
/** @test */
14
20
public function it_can_instantiate (): void
15
21
{
@@ -23,7 +29,7 @@ public function it_can_run_update(): void
23
29
$ http = resolve (HttpRepositoryType::class);
24
30
25
31
$ release = resolve (Release::class);
26
- $ release ->setStoragePath (' /tmp ' )
32
+ $ release ->setStoragePath (( string ) config ( ' self-update.repository_types.http.download_path ' ) )
27
33
->setRelease ('release-1.0.zip ' )
28
34
->updateStoragePath ()
29
35
->setDownloadUrl ('some-local-file ' )
@@ -161,7 +167,7 @@ public function it_cannot_get_new_version_available_and_fails_with_exception():
161
167
{
162
168
$ this ->expectException (InvalidArgumentException::class);
163
169
164
- /** @var HttpRepositoryType $github */
170
+ /** @var HttpRepositoryType $http */
165
171
$ http = resolve (HttpRepositoryType::class);
166
172
$ http ->isNewVersionAvailable ('' );
167
173
}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ protected function getEnvironmentSetUp($app)
56
56
'type ' => 'http ' ,
57
57
'repository_url ' => 'https://github.com/invoiceninja/invoiceninja/releases ' ,
58
58
'pkg_filename_format ' => env ('SELF_UPDATER_PKG_FILENAME_FORMAT ' , 'v_VERSION_ ' ),
59
- 'download_path ' => env ( ' SELF_UPDATER_DOWNLOAD_PATH ' , ' /tmp ' ) ,
59
+ 'download_path ' => self :: DOWNLOAD_PATH ,
60
60
'private_access_token ' => '' ,
61
61
],
62
62
],
You can’t perform that action at this time.
0 commit comments