@@ -66,8 +66,16 @@ public function it_cannot_fetch_releases_because_there_is_no_release(): void
66
66
/** @test */
67
67
public function it_cannot_fetch_releases_because_there_is_no_release_with_access_token (): void
68
68
{
69
+ $ client = $ this ->getMockedClient ([
70
+ $ this ->getResponse200Type ('http ' ),
71
+ $ this ->getResponse200ZipFile (),
72
+ $ this ->getResponse200Type ('http ' ),
73
+ $ this ->getResponse200Type ('http ' ),
74
+ ]);
75
+ $ this ->app ->instance (Client::class, $ client );
76
+
69
77
/** @var HttpRepositoryType $http */
70
- $ http = resolve (HttpRepositoryType::class);
78
+ $ http = $ this -> app -> make (HttpRepositoryType::class);
71
79
$ http ->setAccessToken ('123 ' );
72
80
73
81
$ this ->assertInstanceOf (Release::class, $ http ->fetch ());
@@ -76,18 +84,23 @@ public function it_cannot_fetch_releases_because_there_is_no_release_with_access
76
84
$ this ->assertInstanceOf (Release::class, $ http ->fetch ());
77
85
}
78
86
79
-
87
+ /** @test */
80
88
public function it_can_fetch_http_releases (): void
81
89
{
90
+ $ client = $ this ->getMockedClient ([
91
+ $ this ->getResponse200Type ('http ' ),
92
+ $ this ->getResponse200ZipFile (),
93
+ $ this ->getResponse200Type ('http ' ),
94
+ $ this ->getResponse200Type ('http ' ),
95
+ ]);
96
+ $ this ->app ->instance (Client::class, $ client );
97
+
82
98
/** @var HttpRepositoryType $http */
83
- $ http = resolve (HttpRepositoryType::class);
99
+ $ http = $ this -> app -> make (HttpRepositoryType::class);
84
100
85
101
$ release = $ http ->fetch ();
86
102
87
103
$ this ->assertInstanceOf (Release::class, $ release );
88
-
89
- // Fetch again when source is already fetched
90
- $ this ->assertInstanceOf (Release::class, $ http ->fetch ());
91
104
}
92
105
93
106
/** @test */
@@ -154,7 +167,7 @@ public function it_cannot_get_new_version_available_and_fails_with_exception():
154
167
}
155
168
156
169
/** @test */
157
- public function it_can_get_new_version_available_from_type_tag_without_version_file (): void
170
+ public function it_can_get_new_version_available_without_version_file (): void
158
171
{
159
172
$ client = $ this ->getMockedClient ([
160
173
$ this ->getResponse200Type ('http ' ),
@@ -163,7 +176,7 @@ public function it_can_get_new_version_available_from_type_tag_without_version_f
163
176
$ this ->app ->instance (Client::class, $ client );
164
177
165
178
/** @var HttpRepositoryType $http */
166
- $ http = resolve (HttpRepositoryType::class);
179
+ $ http = $ this -> app -> make (HttpRepositoryType::class);
167
180
$ http ->deleteVersionFile ();
168
181
169
182
$ this ->assertTrue ($ http ->isNewVersionAvailable ('4.5 ' ));
0 commit comments