setup-php 1.11.2 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +433 -458
- package/lib/config.d.ts +3 -0
- package/lib/config.js +71 -71
- package/lib/config.js.map +1 -1
- package/lib/coverage.d.ts +4 -0
- package/lib/coverage.js +97 -87
- package/lib/coverage.js.map +1 -1
- package/lib/extensions.d.ts +4 -0
- package/lib/extensions.js +188 -200
- package/lib/extensions.js.map +1 -1
- package/lib/install.d.ts +2 -0
- package/lib/install.js +96 -81
- package/lib/install.js.map +1 -1
- package/lib/tools.d.ts +18 -0
- package/lib/tools.js +306 -386
- package/lib/tools.js.map +1 -1
- package/lib/utils.d.ts +15 -0
- package/lib/utils.js +205 -291
- package/lib/utils.js.map +1 -1
- package/package.json +66 -56
- package/src/config.ts +82 -82
- package/src/configs/brew_extensions +28 -0
- package/src/configs/php-versions.json +5 -5
- package/src/configs/phpunit.json +24 -24
- package/src/coverage.ts +146 -146
- package/src/extensions.ts +235 -233
- package/src/install.ts +104 -104
- package/src/scripts/darwin.sh +341 -339
- package/src/scripts/ext/gearman.sh +22 -22
- package/src/scripts/ext/phalcon.ps1 +55 -55
- package/src/scripts/ext/phalcon.sh +70 -70
- package/src/scripts/linux.sh +361 -361
- package/src/scripts/win32.ps1 +326 -333
- package/src/tools.ts +472 -469
- package/src/utils.ts +319 -316
- package/.eslintrc.json +0 -16
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/CONTRIBUTING.md +0 -69
- package/.github/FUNDING.yml +0 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -38
- package/.github/SECURITY.md +0 -29
- package/.github/workflows/main-workflow.yml +0 -56
- package/.github/workflows/node-workflow.yml +0 -47
- package/.idea/workspace.xml +0 -113
- package/.prettierrc.json +0 -12
- package/__tests__/config.test.ts +0 -52
- package/__tests__/coverage.test.ts +0 -110
- package/__tests__/extensions.test.ts +0 -120
- package/__tests__/install.test.ts +0 -181
- package/__tests__/tools.test.ts +0 -476
- package/__tests__/utils.test.ts +0 -213
- package/action.yml +0 -38
- package/dist/index.js +0 -2854
- package/examples/bedrock.yml +0 -32
- package/examples/cakephp-mysql.yml +0 -114
- package/examples/cakephp-postgres.yml +0 -112
- package/examples/cakephp.yml +0 -92
- package/examples/codeigniter.yml +0 -34
- package/examples/laravel-mysql.yml +0 -74
- package/examples/laravel-postgres.yml +0 -74
- package/examples/laravel.yml +0 -42
- package/examples/lumen-mysql.yml +0 -74
- package/examples/lumen-postgres.yml +0 -74
- package/examples/lumen.yml +0 -38
- package/examples/phalcon-mysql.yml +0 -74
- package/examples/phalcon-postgres.yml +0 -73
- package/examples/sage.yml +0 -57
- package/examples/slim-framework.yml +0 -34
- package/examples/symfony-mysql.yml +0 -56
- package/examples/symfony-postgres.yml +0 -54
- package/examples/symfony.yml +0 -39
- package/examples/yii2-mysql.yml +0 -73
- package/examples/yii2-postgres.yml +0 -71
- package/examples/zend-framework.yml +0 -36
- package/jest.config.js +0 -12
- package/lib/sapi.js +0 -64
- package/tsconfig.json +0 -18
package/__tests__/tools.test.ts
DELETED
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
import * as tools from '../src/tools';
|
|
2
|
-
|
|
3
|
-
describe('Tools tests', () => {
|
|
4
|
-
it('checking getCommand', async () => {
|
|
5
|
-
expect(await tools.getCommand('linux', 'tool')).toBe('add_tool ');
|
|
6
|
-
expect(await tools.getCommand('darwin', 'tool')).toBe('add_tool ');
|
|
7
|
-
expect(await tools.getCommand('win32', 'tool')).toBe('Add-Tool ');
|
|
8
|
-
expect(await tools.getCommand('openbsd', 'tool')).toContain(
|
|
9
|
-
'Platform openbsd is not supported'
|
|
10
|
-
);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('checking getCommand', async () => {
|
|
14
|
-
expect(await tools.getCommand('linux', 'composertool')).toBe(
|
|
15
|
-
'add_composertool '
|
|
16
|
-
);
|
|
17
|
-
expect(await tools.getCommand('darwin', 'composertool')).toBe(
|
|
18
|
-
'add_composertool '
|
|
19
|
-
);
|
|
20
|
-
expect(await tools.getCommand('win32', 'composertool')).toBe(
|
|
21
|
-
'Add-Composertool '
|
|
22
|
-
);
|
|
23
|
-
expect(await tools.getCommand('openbsd', 'composertool')).toContain(
|
|
24
|
-
'Platform openbsd is not supported'
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('checking getCommand', async () => {
|
|
29
|
-
expect(await tools.getCommand('linux', 'pecl')).toBe('add_pecl ');
|
|
30
|
-
expect(await tools.getCommand('darwin', 'pecl')).toBe('add_pecl ');
|
|
31
|
-
expect(await tools.getCommand('win32', 'pecl')).toBe('Add-Pecl ');
|
|
32
|
-
expect(await tools.getCommand('openbsd', 'pecl')).toContain(
|
|
33
|
-
'Platform openbsd is not supported'
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('checking parseToolVersion', async () => {
|
|
38
|
-
expect(await tools.getToolVersion('latest')).toBe('latest');
|
|
39
|
-
expect(await tools.getToolVersion('1.2.3')).toBe('1.2.3');
|
|
40
|
-
expect(await tools.getToolVersion('^1.2.3')).toBe('1.2.3');
|
|
41
|
-
expect(await tools.getToolVersion('>=1.2.3')).toBe('1.2.3');
|
|
42
|
-
expect(await tools.getToolVersion('>1.2.3')).toBe('1.2.3');
|
|
43
|
-
expect(await tools.getToolVersion('1.2.3-ALPHA')).toBe('1.2.3-ALPHA');
|
|
44
|
-
expect(await tools.getToolVersion('1.2.3-alpha')).toBe('1.2.3-alpha');
|
|
45
|
-
expect(await tools.getToolVersion('1.2.3-beta')).toBe('1.2.3-beta');
|
|
46
|
-
expect(await tools.getToolVersion('1.2.3-rc')).toBe('1.2.3-rc');
|
|
47
|
-
expect(await tools.getToolVersion('1.2.3-dev')).toBe('1.2.3-dev');
|
|
48
|
-
expect(await tools.getToolVersion('1.2.3-alpha1')).toBe('1.2.3-alpha1');
|
|
49
|
-
expect(await tools.getToolVersion('1.2.3-alpha.1')).toBe('1.2.3-alpha.1');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('checking parseToolVersion', async () => {
|
|
53
|
-
expect(await tools.parseTool('phpunit')).toStrictEqual({
|
|
54
|
-
name: 'phpunit',
|
|
55
|
-
version: 'latest'
|
|
56
|
-
});
|
|
57
|
-
expect(await tools.parseTool('phpunit:1.2.3')).toStrictEqual({
|
|
58
|
-
name: 'phpunit',
|
|
59
|
-
version: '1.2.3'
|
|
60
|
-
});
|
|
61
|
-
expect(await tools.parseTool('phpunit:^1.2.3')).toStrictEqual({
|
|
62
|
-
name: 'phpunit',
|
|
63
|
-
version: '1.2.3'
|
|
64
|
-
});
|
|
65
|
-
expect(await tools.parseTool('phpunit:>=1.2.3')).toStrictEqual({
|
|
66
|
-
name: 'phpunit',
|
|
67
|
-
version: '1.2.3'
|
|
68
|
-
});
|
|
69
|
-
expect(await tools.parseTool('phpunit:>1.2.3')).toStrictEqual({
|
|
70
|
-
name: 'phpunit',
|
|
71
|
-
version: '1.2.3'
|
|
72
|
-
});
|
|
73
|
-
expect(await tools.parseTool('phpunit:1.2.3-ALPHA')).toStrictEqual({
|
|
74
|
-
name: 'phpunit',
|
|
75
|
-
version: '1.2.3-ALPHA'
|
|
76
|
-
});
|
|
77
|
-
expect(await tools.parseTool('phpunit:1.2.3-alpha')).toStrictEqual({
|
|
78
|
-
name: 'phpunit',
|
|
79
|
-
version: '1.2.3-alpha'
|
|
80
|
-
});
|
|
81
|
-
expect(await tools.parseTool('phpunit:1.2.3-beta')).toStrictEqual({
|
|
82
|
-
name: 'phpunit',
|
|
83
|
-
version: '1.2.3-beta'
|
|
84
|
-
});
|
|
85
|
-
expect(await tools.parseTool('phpunit:1.2.3-rc')).toStrictEqual({
|
|
86
|
-
name: 'phpunit',
|
|
87
|
-
version: '1.2.3-rc'
|
|
88
|
-
});
|
|
89
|
-
expect(await tools.parseTool('phpunit:1.2.3-dev')).toStrictEqual({
|
|
90
|
-
name: 'phpunit',
|
|
91
|
-
version: '1.2.3-dev'
|
|
92
|
-
});
|
|
93
|
-
expect(await tools.parseTool('phpunit:1.2.3-alpha1')).toStrictEqual({
|
|
94
|
-
name: 'phpunit',
|
|
95
|
-
version: '1.2.3-alpha1'
|
|
96
|
-
});
|
|
97
|
-
expect(await tools.parseTool('phpunit:1.2.3-alpha.1')).toStrictEqual({
|
|
98
|
-
name: 'phpunit',
|
|
99
|
-
version: '1.2.3-alpha.1'
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('checking getUri', async () => {
|
|
104
|
-
expect(
|
|
105
|
-
await tools.getUri('tool', '.phar', 'latest', 'releases', '', 'download')
|
|
106
|
-
).toBe('releases/latest/download/tool.phar');
|
|
107
|
-
expect(
|
|
108
|
-
await tools.getUri('tool', '.phar', '1.2.3', 'releases', '', 'download')
|
|
109
|
-
).toBe('releases/download/1.2.3/tool.phar');
|
|
110
|
-
expect(
|
|
111
|
-
await tools.getUri('tool', '.phar', '1.2.3', 'releases', 'v', 'download')
|
|
112
|
-
).toBe('releases/download/v1.2.3/tool.phar');
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('checking addPhive', async () => {
|
|
116
|
-
let script: string = await tools.addPhive('1.2.3', '7.4', 'linux');
|
|
117
|
-
expect(script).toContain(
|
|
118
|
-
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
script = await tools.addPhive('latest', '5.6', 'win32');
|
|
122
|
-
expect(script).toContain(
|
|
123
|
-
'Add-Tool https://github.com/phar-io/phive/releases/download/0.12.1/phive-0.12.1.phar phive'
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
script = await tools.addPhive('latest', '7.1', 'win32');
|
|
127
|
-
expect(script).toContain(
|
|
128
|
-
'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.5/phive-0.13.5.phar phive'
|
|
129
|
-
);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('checking getPhpunitUri', async () => {
|
|
133
|
-
expect(await tools.getPharUrl('domain', 'tool', '', 'latest')).toBe(
|
|
134
|
-
'domain/tool.phar'
|
|
135
|
-
);
|
|
136
|
-
expect(await tools.getPharUrl('domain', 'tool', 'v', '1.2.3')).toBe(
|
|
137
|
-
'domain/tool-v1.2.3.phar'
|
|
138
|
-
);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('checking getDeployerUri', async () => {
|
|
142
|
-
expect(await tools.getDeployerUrl('latest')).toBe(
|
|
143
|
-
'https://deployer.org/deployer.phar'
|
|
144
|
-
);
|
|
145
|
-
expect(await tools.getDeployerUrl('1.2.3')).toBe(
|
|
146
|
-
'https://deployer.org/releases/v1.2.3/deployer.phar'
|
|
147
|
-
);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('checking addComposer', async () => {
|
|
151
|
-
expect(await tools.addComposer(['a', 'b'])).toStrictEqual([
|
|
152
|
-
'composer',
|
|
153
|
-
'a',
|
|
154
|
-
'b'
|
|
155
|
-
]);
|
|
156
|
-
expect(await tools.addComposer(['a', 'b', 'composer'])).toStrictEqual([
|
|
157
|
-
'composer',
|
|
158
|
-
'a',
|
|
159
|
-
'b'
|
|
160
|
-
]);
|
|
161
|
-
expect(await tools.addComposer(['a', 'b', 'composer:1.2'])).toStrictEqual([
|
|
162
|
-
'composer',
|
|
163
|
-
'a',
|
|
164
|
-
'b'
|
|
165
|
-
]);
|
|
166
|
-
expect(await tools.addComposer(['a', 'b', 'composer:1.2.3'])).toStrictEqual(
|
|
167
|
-
['composer:1.2.3', 'a', 'b']
|
|
168
|
-
);
|
|
169
|
-
expect(
|
|
170
|
-
await tools.addComposer(['a', 'b', 'composer:v1.2.3'])
|
|
171
|
-
).toStrictEqual(['composer:1.2.3', 'a', 'b']);
|
|
172
|
-
expect(
|
|
173
|
-
await tools.addComposer(['a', 'b', 'composer:snapshot'])
|
|
174
|
-
).toStrictEqual(['composer:snapshot', 'a', 'b']);
|
|
175
|
-
expect(
|
|
176
|
-
await tools.addComposer(['a', 'b', 'composer:preview'])
|
|
177
|
-
).toStrictEqual(['composer:preview', 'a', 'b']);
|
|
178
|
-
expect(
|
|
179
|
-
await tools.addComposer(['a', 'b', 'c', 'composer:1'])
|
|
180
|
-
).toStrictEqual(['composer:1', 'a', 'b', 'c']);
|
|
181
|
-
expect(
|
|
182
|
-
await tools.addComposer(['a', 'b', 'c', 'composer:2'])
|
|
183
|
-
).toStrictEqual(['composer:2', 'a', 'b', 'c']);
|
|
184
|
-
expect(
|
|
185
|
-
await tools.addComposer(['a', 'b', 'c', 'composer:v1'])
|
|
186
|
-
).toStrictEqual(['composer:1', 'a', 'b', 'c']);
|
|
187
|
-
expect(
|
|
188
|
-
await tools.addComposer(['a', 'b', 'c', 'composer:v2'])
|
|
189
|
-
).toStrictEqual(['composer:2', 'a', 'b', 'c']);
|
|
190
|
-
expect(
|
|
191
|
-
await tools.addComposer(['hirak', 'b', 'c', 'composer:v2'])
|
|
192
|
-
).toStrictEqual(['composer:1', 'hirak', 'b', 'c']);
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
it('checking getComposerUrl', async () => {
|
|
196
|
-
expect(await tools.getComposerUrl('latest')).toContain(
|
|
197
|
-
'https://getcomposer.org/composer-stable.phar'
|
|
198
|
-
);
|
|
199
|
-
expect(await tools.getComposerUrl('stable')).toContain(
|
|
200
|
-
'https://getcomposer.org/composer-stable.phar'
|
|
201
|
-
);
|
|
202
|
-
expect(await tools.getComposerUrl('snapshot')).toContain(
|
|
203
|
-
'https://getcomposer.org/composer.phar'
|
|
204
|
-
);
|
|
205
|
-
expect(await tools.getComposerUrl('preview')).toContain(
|
|
206
|
-
'https://getcomposer.org/composer-preview.phar'
|
|
207
|
-
);
|
|
208
|
-
expect(await tools.getComposerUrl('1')).toContain(
|
|
209
|
-
'https://getcomposer.org/composer-1.phar'
|
|
210
|
-
);
|
|
211
|
-
expect(await tools.getComposerUrl('2')).toContain(
|
|
212
|
-
'https://getcomposer.org/composer-2.phar'
|
|
213
|
-
);
|
|
214
|
-
expect(await tools.getComposerUrl('1.7.2')).toContain(
|
|
215
|
-
'https://github.com/composer/composer/releases/download/1.7.2/composer.phar'
|
|
216
|
-
);
|
|
217
|
-
expect(await tools.getComposerUrl('1.7.2')).toContain(
|
|
218
|
-
'https://getcomposer.org/composer-1.7.2.phar'
|
|
219
|
-
);
|
|
220
|
-
expect(await tools.getComposerUrl('2.0.0-RC2')).toContain(
|
|
221
|
-
'https://github.com/composer/composer/releases/download/2.0.0-RC2/composer.phar'
|
|
222
|
-
);
|
|
223
|
-
expect(await tools.getComposerUrl('2.0.0-RC2')).toContain(
|
|
224
|
-
'https://getcomposer.org/composer-2.0.0-RC2.phar'
|
|
225
|
-
);
|
|
226
|
-
expect(await tools.getComposerUrl('wrong')).toContain(
|
|
227
|
-
'https://getcomposer.org/composer-stable.phar'
|
|
228
|
-
);
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
it('checking getSymfonyUri', async () => {
|
|
232
|
-
expect(await tools.getSymfonyUri('latest', 'linux')).toContain(
|
|
233
|
-
'releases/latest/download/symfony_linux_amd64'
|
|
234
|
-
);
|
|
235
|
-
expect(await tools.getSymfonyUri('1.2.3', 'linux')).toContain(
|
|
236
|
-
'releases/download/v1.2.3/symfony_linux_amd64'
|
|
237
|
-
);
|
|
238
|
-
expect(await tools.getSymfonyUri('latest', 'darwin')).toContain(
|
|
239
|
-
'releases/latest/download/symfony_darwin_amd64'
|
|
240
|
-
);
|
|
241
|
-
expect(await tools.getSymfonyUri('1.2.3', 'darwin')).toContain(
|
|
242
|
-
'releases/download/v1.2.3/symfony_darwin_amd64'
|
|
243
|
-
);
|
|
244
|
-
expect(await tools.getSymfonyUri('latest', 'win32')).toContain(
|
|
245
|
-
'releases/latest/download/symfony_windows_amd64'
|
|
246
|
-
);
|
|
247
|
-
expect(await tools.getSymfonyUri('1.2.3', 'win32')).toContain(
|
|
248
|
-
'releases/download/v1.2.3/symfony_windows_amd64'
|
|
249
|
-
);
|
|
250
|
-
expect(await tools.getSymfonyUri('1.2.3', 'openbsd')).toContain(
|
|
251
|
-
'Platform openbsd is not supported'
|
|
252
|
-
);
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
it('checking getCleanedToolsList', async () => {
|
|
256
|
-
const tools_list: string[] = await tools.getCleanedToolsList(
|
|
257
|
-
'tool, composer:1.2.3, robmorgan/phinx'
|
|
258
|
-
);
|
|
259
|
-
expect(tools_list).toStrictEqual(['composer:1.2.3', 'tool', 'phinx']);
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
it('checking addArchive', async () => {
|
|
263
|
-
let script: string = await tools.addArchive(
|
|
264
|
-
'tool',
|
|
265
|
-
'https://tool.com/tool.phar',
|
|
266
|
-
'linux'
|
|
267
|
-
);
|
|
268
|
-
expect(script).toContain('add_tool https://tool.com/tool.phar tool');
|
|
269
|
-
script = await tools.addArchive(
|
|
270
|
-
'tool',
|
|
271
|
-
'https://tool.com/tool.phar',
|
|
272
|
-
'darwin'
|
|
273
|
-
);
|
|
274
|
-
expect(script).toContain('add_tool https://tool.com/tool.phar tool');
|
|
275
|
-
script = await tools.addArchive(
|
|
276
|
-
'tool',
|
|
277
|
-
'https://tool.com/tool.phar',
|
|
278
|
-
'win32'
|
|
279
|
-
);
|
|
280
|
-
expect(script).toContain('Add-Tool https://tool.com/tool.phar tool');
|
|
281
|
-
|
|
282
|
-
script = await tools.addArchive(
|
|
283
|
-
'tool',
|
|
284
|
-
'https://tool.com/tool.phar',
|
|
285
|
-
'openbsd'
|
|
286
|
-
);
|
|
287
|
-
expect(script).toContain('Platform openbsd is not supported');
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
it('checking addDevTools', async () => {
|
|
291
|
-
let script: string = await tools.addDevTools('phpize', 'linux');
|
|
292
|
-
expect(script).toContain('add_devtools');
|
|
293
|
-
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
|
294
|
-
|
|
295
|
-
script = await tools.addDevTools('php-config', 'linux');
|
|
296
|
-
expect(script).toContain('add_devtools');
|
|
297
|
-
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
|
298
|
-
|
|
299
|
-
script = await tools.addDevTools('phpize', 'darwin');
|
|
300
|
-
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
|
301
|
-
|
|
302
|
-
script = await tools.addDevTools('php-config', 'darwin');
|
|
303
|
-
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
|
304
|
-
|
|
305
|
-
script = await tools.addDevTools('phpize', 'win32');
|
|
306
|
-
expect(script).toContain(
|
|
307
|
-
'Add-Log "$cross" "phpize" "phpize is not a windows tool"'
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
script = await tools.addDevTools('php-config', 'win32');
|
|
311
|
-
expect(script).toContain(
|
|
312
|
-
'Add-Log "$cross" "php-config" "php-config is not a windows tool"'
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
script = await tools.addDevTools('tool', 'openbsd');
|
|
316
|
-
expect(script).toContain('Platform openbsd is not supported');
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
it('checking addPackage', async () => {
|
|
320
|
-
let script: string = await tools.addPackage(
|
|
321
|
-
'tool',
|
|
322
|
-
'tool:1.2.3',
|
|
323
|
-
'user/',
|
|
324
|
-
'linux'
|
|
325
|
-
);
|
|
326
|
-
expect(script).toContain('add_composertool tool tool:1.2.3 user/');
|
|
327
|
-
|
|
328
|
-
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'darwin');
|
|
329
|
-
expect(script).toContain('add_composertool tool tool:1.2.3 user/');
|
|
330
|
-
|
|
331
|
-
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'win32');
|
|
332
|
-
expect(script).toContain('Add-Composertool tool tool:1.2.3 user/');
|
|
333
|
-
|
|
334
|
-
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'openbsd');
|
|
335
|
-
expect(script).toContain('Platform openbsd is not supported');
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
it('checking addTools on linux', async () => {
|
|
339
|
-
const script: string = await tools.addTools(
|
|
340
|
-
'cs2pr, php-cs-fixer, phpstan, phpunit, pecl, phinx, phinx:1.2.3, phive, php-config, phpize, symfony',
|
|
341
|
-
'7.4',
|
|
342
|
-
'linux'
|
|
343
|
-
);
|
|
344
|
-
expect(script).toContain(
|
|
345
|
-
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
|
346
|
-
);
|
|
347
|
-
expect(script).toContain(
|
|
348
|
-
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
|
349
|
-
);
|
|
350
|
-
expect(script).toContain(
|
|
351
|
-
'add_tool https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/latest/download/php-cs-fixer.phar php-cs-fixer'
|
|
352
|
-
);
|
|
353
|
-
expect(script).toContain(
|
|
354
|
-
'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan'
|
|
355
|
-
);
|
|
356
|
-
expect(script).toContain(
|
|
357
|
-
'add_tool https://phar.io/releases/phive.phar phive'
|
|
358
|
-
);
|
|
359
|
-
expect(script).toContain(
|
|
360
|
-
'add_tool https://phar.phpunit.de/phpunit.phar phpunit'
|
|
361
|
-
);
|
|
362
|
-
expect(script).toContain(
|
|
363
|
-
'add_tool https://github.com/symfony/cli/releases/latest/download/symfony_linux_amd64 symfony'
|
|
364
|
-
);
|
|
365
|
-
expect(script).toContain('add_pecl');
|
|
366
|
-
expect(script).toContain('add_composertool phinx phinx robmorgan/');
|
|
367
|
-
expect(script).toContain('add_composertool phinx phinx:1.2.3 robmorgan/');
|
|
368
|
-
expect(script).toContain('add_devtools');
|
|
369
|
-
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
|
370
|
-
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
|
371
|
-
});
|
|
372
|
-
it('checking addTools on darwin', async () => {
|
|
373
|
-
const script: string = await tools.addTools(
|
|
374
|
-
'phpcs, phpcbf, phpcpd, phpmd, psalm, phinx, phive:1.2.3, cs2pr:1.2.3, phpize, php-config, symfony:1.2.3',
|
|
375
|
-
'7.4',
|
|
376
|
-
'darwin'
|
|
377
|
-
);
|
|
378
|
-
expect(script).toContain(
|
|
379
|
-
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
|
380
|
-
);
|
|
381
|
-
expect(script).toContain(
|
|
382
|
-
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr'
|
|
383
|
-
);
|
|
384
|
-
expect(script).toContain(
|
|
385
|
-
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs'
|
|
386
|
-
);
|
|
387
|
-
expect(script).toContain(
|
|
388
|
-
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf'
|
|
389
|
-
);
|
|
390
|
-
expect(script).toContain(
|
|
391
|
-
'add_tool https://phar.phpunit.de/phpcpd.phar phpcpd'
|
|
392
|
-
);
|
|
393
|
-
expect(script).toContain(
|
|
394
|
-
'add_tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd'
|
|
395
|
-
);
|
|
396
|
-
expect(script).toContain(
|
|
397
|
-
'https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm'
|
|
398
|
-
);
|
|
399
|
-
expect(script).toContain('add_composertool phinx phinx robmorgan/');
|
|
400
|
-
expect(script).toContain(
|
|
401
|
-
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
|
|
402
|
-
);
|
|
403
|
-
expect(script).toContain(
|
|
404
|
-
'add_tool https://github.com/symfony/cli/releases/download/v1.2.3/symfony_darwin_amd64 symfony'
|
|
405
|
-
);
|
|
406
|
-
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
|
407
|
-
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
|
408
|
-
});
|
|
409
|
-
it('checking addTools on windows', async () => {
|
|
410
|
-
const script: string = await tools.addTools(
|
|
411
|
-
'cs2pr, deployer, phpmd, phinx, phive:0.13.2, php-config, phpize, symfony, does_not_exist, composer',
|
|
412
|
-
'7.4',
|
|
413
|
-
'win32'
|
|
414
|
-
);
|
|
415
|
-
expect(script).toContain(
|
|
416
|
-
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
|
417
|
-
);
|
|
418
|
-
expect(script).toContain(
|
|
419
|
-
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
|
420
|
-
);
|
|
421
|
-
expect(script).toContain(
|
|
422
|
-
'Add-Tool https://deployer.org/deployer.phar deployer'
|
|
423
|
-
);
|
|
424
|
-
expect(script).toContain(
|
|
425
|
-
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd'
|
|
426
|
-
);
|
|
427
|
-
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
|
|
428
|
-
expect(script).toContain(
|
|
429
|
-
'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar phive'
|
|
430
|
-
);
|
|
431
|
-
expect(script).toContain(
|
|
432
|
-
'Add-Tool https://github.com/symfony/cli/releases/latest/download/symfony_windows_amd64.exe symfony'
|
|
433
|
-
);
|
|
434
|
-
expect(script).toContain('phpize is not a windows tool');
|
|
435
|
-
expect(script).toContain('php-config is not a windows tool');
|
|
436
|
-
expect(script).toContain('Tool does_not_exist is not supported');
|
|
437
|
-
});
|
|
438
|
-
it('checking addTools with composer tool using user/tool as input', async () => {
|
|
439
|
-
const script: string = await tools.addTools(
|
|
440
|
-
'codeception/codeception, hirak/prestissimo, narrowspark/automatic-composer-prefetcher, robmorgan/phinx',
|
|
441
|
-
'7.4',
|
|
442
|
-
'win32'
|
|
443
|
-
);
|
|
444
|
-
expect(script).toContain(
|
|
445
|
-
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
|
|
446
|
-
);
|
|
447
|
-
expect(script).toContain('Add-Composertool prestissimo prestissimo hirak/');
|
|
448
|
-
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
|
|
449
|
-
expect(script).toContain(
|
|
450
|
-
'Add-Composertool composer-prefetcher composer-prefetcher narrowspark/automatic-'
|
|
451
|
-
);
|
|
452
|
-
});
|
|
453
|
-
it('checking composer setup', async () => {
|
|
454
|
-
let script: string = await tools.addTools(
|
|
455
|
-
'composer, composer:v1',
|
|
456
|
-
'7.4',
|
|
457
|
-
'linux'
|
|
458
|
-
);
|
|
459
|
-
expect(script).toContain(
|
|
460
|
-
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
|
|
461
|
-
);
|
|
462
|
-
|
|
463
|
-
script = await tools.addTools('composer:preview', '7.4', 'linux');
|
|
464
|
-
expect(script).toContain(
|
|
465
|
-
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-preview.phar,https://getcomposer.org/composer-preview.phar composer'
|
|
466
|
-
);
|
|
467
|
-
script = await tools.addTools(
|
|
468
|
-
'composer:v1, composer:preview, composer:snapshot',
|
|
469
|
-
'7.4',
|
|
470
|
-
'linux'
|
|
471
|
-
);
|
|
472
|
-
expect(script).toContain(
|
|
473
|
-
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-snapshot.phar,https://getcomposer.org/composer.phar composer'
|
|
474
|
-
);
|
|
475
|
-
});
|
|
476
|
-
});
|