Skip to content

Commit e4e16ef

Browse files
Updated old tests
1 parent 9ef2cb5 commit e4e16ef

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

tests/Api/RepositoryFilesTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function shouldGetBlob()
1818
$api = $this->getApiMock();
1919
$api->expects($this->once())
2020
->method('get')
21-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt/raw', ['ref' => 'abcd1234'])
21+
->with('projects/1/repository/files/dir%2Ffile1.txt/raw', ['ref' => 'abcd1234'])
2222
->will($this->returnValue($expectedString))
2323
;
2424

@@ -35,7 +35,7 @@ public function shouldGetFile()
3535
$api = $this->getApiMock();
3636
$api->expects($this->once())
3737
->method('get')
38-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', ['ref' => 'abcd1234'])
38+
->with('projects/1/repository/files/dir%2Ffile1.txt', ['ref' => 'abcd1234'])
3939
->will($this->returnValue($expectedArray))
4040
;
4141

@@ -52,7 +52,7 @@ public function shouldCreateFile()
5252
$api = $this->getApiMock();
5353
$api->expects($this->once())
5454
->method('post')
55-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
55+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
5656
'file_path' => 'dir/file1.txt',
5757
'branch' => 'master',
5858
'content' => 'some contents',
@@ -79,7 +79,7 @@ public function shouldCreateFileWithEncoding()
7979
$api = $this->getApiMock();
8080
$api->expects($this->once())
8181
->method('post')
82-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
82+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
8383
'file_path' => 'dir/file1.txt',
8484
'branch' => 'master',
8585
'encoding' => 'text',
@@ -108,7 +108,7 @@ public function shouldCreateFileWithAuthor()
108108
$api = $this->getApiMock();
109109
$api->expects($this->once())
110110
->method('post')
111-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
111+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
112112
'file_path' => 'dir/file1.txt',
113113
'branch' => 'master',
114114
'content' => 'some contents',
@@ -139,7 +139,7 @@ public function shouldUpdateFile()
139139
$api = $this->getApiMock();
140140
$api->expects($this->once())
141141
->method('put')
142-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
142+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
143143
'file_path' => 'dir/file1.txt',
144144
'branch' => 'master',
145145
'content' => 'some new contents',
@@ -166,7 +166,7 @@ public function shouldUpdateFileWithEncoding()
166166
$api = $this->getApiMock();
167167
$api->expects($this->once())
168168
->method('put')
169-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
169+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
170170
'file_path' => 'dir/file1.txt',
171171
'branch' => 'master',
172172
'encoding' => 'base64',
@@ -195,7 +195,7 @@ public function shouldUpdateFileWithAuthor()
195195
$api = $this->getApiMock();
196196
$api->expects($this->once())
197197
->method('put')
198-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
198+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
199199
'file_path' => 'dir/file1.txt',
200200
'branch' => 'master',
201201
'content' => 'some new contents',
@@ -226,7 +226,7 @@ public function shouldDeleteFile()
226226
$api = $this->getApiMock();
227227
$api->expects($this->once())
228228
->method('delete')
229-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
229+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
230230
'file_path' => 'dir/file1.txt',
231231
'branch' => 'master',
232232
'commit_message' => 'Deleted file',
@@ -251,7 +251,7 @@ public function shouldDeleteFileWithAuthor()
251251
$api = $this->getApiMock();
252252
$api->expects($this->once())
253253
->method('delete')
254-
->with('projects/1/repository/files/dir%2Ffile1%2Etxt', [
254+
->with('projects/1/repository/files/dir%2Ffile1.txt', [
255255
'file_path' => 'dir/file1.txt',
256256
'branch' => 'master',
257257
'commit_message' => 'Deleted file',

tests/Api/TagsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function shouldShowTag()
3636
$api = $this->getApiMock();
3737
$api->expects($this->once())
3838
->method('get')
39-
->with('projects/1/repository/tags/v1%2E0%2E0')
39+
->with('projects/1/repository/tags/v1.0.0')
4040
->will($this->returnValue($expectedArray));
4141
$this->assertEquals($expectedArray, $api->show(1, 'v1.0.0'));
4242
}
@@ -77,7 +77,7 @@ public function shouldRemoveTag()
7777
$api = $this->getApiMock();
7878
$api->expects($this->once())
7979
->method('delete')
80-
->with('projects/1/repository/tags/v1%2E1%2E0')
80+
->with('projects/1/repository/tags/v1.1.0')
8181
->will($this->returnValue($expectedArray));
8282
$this->assertEquals($expectedArray, $api->remove(1, 'v1.1.0'));
8383
}
@@ -99,7 +99,7 @@ public function shouldCreateRelease($releaseName, $description, $expectedResult)
9999
$api = $this->getApiMock();
100100
$api->expects($this->once())
101101
->method('post')
102-
->with('projects/1/repository/tags/'.str_replace(['/', '.'], ['%2F', '%2E'], $releaseName).'/release', $params)
102+
->with('projects/1/repository/tags/'.str_replace(['/', '.'], ['%2F', '.'], $releaseName).'/release', $params)
103103
->will($this->returnValue($expectedResult));
104104

105105
$this->assertEquals($expectedResult, $api->createRelease(1, $releaseName, $params));
@@ -122,7 +122,7 @@ public function shouldUpdateRelease($releaseName, $description, $expectedResult)
122122
$api = $this->getApiMock();
123123
$api->expects($this->once())
124124
->method('put')
125-
->with('projects/1/repository/tags/'.str_replace(['/', '.'], ['%2F', '%2E'], $releaseName).'/release', $params)
125+
->with('projects/1/repository/tags/'.str_replace(['/', '.'], ['%2F', '.'], $releaseName).'/release', $params)
126126
->will($this->returnValue($expectedResult));
127127

128128
$this->assertEquals($expectedResult, $api->updateRelease(1, $releaseName, $params));

0 commit comments

Comments
 (0)