setup-php 2.13.0 → 2.17.0
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 +990 -922
- 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 +5 -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 +214 -200
- package/lib/extensions.js.map +1 -1
- package/lib/fetch.d.ts +1 -0
- package/lib/fetch.js +63 -0
- package/lib/fetch.js.map +1 -0
- package/lib/install.d.ts +2 -0
- package/lib/install.js +75 -81
- package/lib/install.js.map +1 -1
- package/lib/tools.d.ts +23 -0
- package/lib/tools.js +367 -386
- package/lib/tools.js.map +1 -1
- package/lib/utils.d.ts +21 -0
- package/lib/utils.js +261 -291
- package/lib/utils.js.map +1 -1
- package/package.json +67 -56
- package/src/config.ts +82 -82
- package/src/configs/brew_extensions +31 -0
- package/src/configs/composer.env +2 -0
- package/src/configs/ini/jit.ini +3 -0
- package/src/configs/ini/php.ini +2 -0
- package/src/configs/ini/xdebug.ini +1 -0
- package/src/configs/os_releases.csv +19 -17
- package/src/configs/php-versions.json +6 -5
- package/src/configs/php_packages +12 -0
- package/src/configs/{php.json → pm/php.json} +29 -29
- package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
- package/src/configs/tools.json +278 -235
- package/src/configs/tools_schema.json +125 -114
- package/src/coverage.ts +144 -142
- package/src/extensions.ts +367 -349
- package/src/fetch.ts +54 -0
- package/src/install.ts +66 -82
- package/src/scripts/darwin.sh +285 -249
- package/src/scripts/extensions/add_extensions.ps1 +194 -0
- package/src/scripts/extensions/add_extensions.sh +184 -0
- package/src/scripts/{ext → extensions}/blackfire.ps1 +32 -32
- package/src/scripts/{ext → extensions}/blackfire.sh +22 -21
- package/src/scripts/{ext → extensions}/couchbase.sh +43 -43
- package/src/scripts/{ext → extensions}/cubrid.sh +60 -60
- package/src/scripts/extensions/extension_map.php +132 -0
- package/src/scripts/{ext → extensions}/firebird.ps1 +19 -19
- package/src/scripts/{ext → extensions}/firebird.sh +39 -35
- package/src/scripts/{ext → extensions}/gearman.sh +22 -22
- package/src/scripts/{ext → extensions}/geos.sh +17 -17
- package/src/scripts/{ext → extensions}/http.ps1 +54 -54
- package/src/scripts/{ext → extensions}/http.sh +109 -120
- package/src/scripts/{ext → extensions}/intl.sh +23 -23
- package/src/scripts/{ext → extensions}/ioncube.ps1 +33 -32
- package/src/scripts/{ext → extensions}/ioncube.sh +21 -19
- package/src/scripts/{ext → extensions}/oci.ps1 +85 -60
- package/src/scripts/{ext → extensions}/oci.sh +65 -63
- package/src/scripts/{ext → extensions}/patches/firebird.sh +11 -11
- package/src/scripts/{ext → extensions}/patches/geos.sh +7 -7
- package/src/scripts/{ext → extensions}/patches/http.sh +11 -11
- package/src/scripts/{ext → extensions}/patches/pdo_oci.sh +6 -6
- package/src/scripts/{ext → extensions}/patches/phpize.sh +26 -26
- package/src/scripts/{ext → extensions}/patches/protobuf.sh +4 -4
- package/src/scripts/{ext → extensions}/phalcon.ps1 +54 -54
- package/src/scripts/{ext → extensions}/phalcon.sh +58 -58
- package/src/scripts/{ext → extensions}/source.sh +145 -144
- package/src/scripts/extensions/sqlsrv.sh +15 -0
- package/src/scripts/linux.sh +269 -256
- package/src/scripts/tools/add_tools.ps1 +239 -26
- package/src/scripts/tools/add_tools.sh +175 -20
- package/src/scripts/tools/blackfire.ps1 +19 -19
- package/src/scripts/tools/blackfire.sh +40 -39
- package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
- package/src/scripts/tools/grpc_php_plugin.sh +58 -58
- package/src/scripts/tools/ppa.sh +192 -151
- package/src/scripts/tools/protoc.ps1 +38 -38
- package/src/scripts/tools/protoc.sh +28 -28
- package/src/scripts/tools/symfony.ps1 +14 -0
- package/src/scripts/tools/symfony.sh +13 -0
- package/src/scripts/unix.sh +186 -0
- package/src/scripts/win32.ps1 +352 -494
- package/src/tools.ts +512 -538
- package/src/utils.ts +415 -500
- package/.eslintrc.json +0 -16
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/CONTRIBUTING.md +0 -70
- package/.github/FUNDING.yml +0 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
- package/.github/SECURITY.md +0 -29
- package/.github/workflows/docs.yml +0 -77
- package/.github/workflows/node-workflow.yml +0 -51
- package/.github/workflows/workflow.yml +0 -78
- 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 -263
- package/__tests__/install.test.ts +0 -175
- package/__tests__/tools.test.ts +0 -524
- package/__tests__/utils.test.ts +0 -307
- package/action.yml +0 -29
- package/dist/index.js +0 -3051
- package/examples/bedrock.yml +0 -32
- package/examples/blackfire-player.yml +0 -31
- package/examples/blackfire.yml +0 -31
- 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 -57
- package/examples/symfony-postgres.yml +0 -55
- 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/src/scripts/common.sh +0 -314
- package/tsconfig.json +0 -18
package/__tests__/config.test.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as config from '../src/config';
|
|
2
|
-
|
|
3
|
-
describe('Config tests', () => {
|
|
4
|
-
it('checking addINIValuesOnWindows', async () => {
|
|
5
|
-
let win32: string = await config.addINIValues(
|
|
6
|
-
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
|
7
|
-
'win32'
|
|
8
|
-
);
|
|
9
|
-
expect(win32).toContain(
|
|
10
|
-
'Add-Content "$php_dir\\php.ini" "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
win32 = await config.addINIValues(
|
|
14
|
-
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
|
15
|
-
'openbsd'
|
|
16
|
-
);
|
|
17
|
-
expect(win32).toContain('Platform openbsd is not supported');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('checking addINIValuesOnLinux', async () => {
|
|
21
|
-
let linux: string = await config.addINIValues(
|
|
22
|
-
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
|
23
|
-
'linux',
|
|
24
|
-
true
|
|
25
|
-
);
|
|
26
|
-
expect(linux).toContain(
|
|
27
|
-
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
linux = await config.addINIValues(
|
|
31
|
-
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
|
32
|
-
'openbsd'
|
|
33
|
-
);
|
|
34
|
-
expect(linux).toContain('Platform openbsd is not supported');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('checking addINIValuesOnDarwin', async () => {
|
|
38
|
-
let darwin: string = await config.addINIValues(
|
|
39
|
-
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
|
40
|
-
'darwin'
|
|
41
|
-
);
|
|
42
|
-
expect(darwin).toContain(
|
|
43
|
-
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
darwin = await config.addINIValues(
|
|
47
|
-
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
|
48
|
-
'openbsd'
|
|
49
|
-
);
|
|
50
|
-
expect(darwin).toContain('Platform openbsd is not supported');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import * as coverage from '../src/coverage';
|
|
2
|
-
|
|
3
|
-
describe('Config tests', () => {
|
|
4
|
-
it('checking addCoverage with PCOV on windows', async () => {
|
|
5
|
-
let win32: string = await coverage.addCoverage('PCOV', '7.4', 'win32');
|
|
6
|
-
expect(win32).toContain('Add-Extension pcov');
|
|
7
|
-
expect(win32).toContain('Remove-Extension xdebug');
|
|
8
|
-
|
|
9
|
-
win32 = await coverage.addCoverage('pcov', '7.0', 'win32');
|
|
10
|
-
expect(win32).toContain('PHP 7.1 or newer is required');
|
|
11
|
-
|
|
12
|
-
win32 = await coverage.addCoverage('pcov', '5.6', 'win32');
|
|
13
|
-
expect(win32).toContain('PHP 7.1 or newer is required');
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('checking addCoverage with PCOV on linux', async () => {
|
|
17
|
-
const linux: string = await coverage.addCoverage('pcov', '7.4', 'linux');
|
|
18
|
-
expect(linux).toContain('add_extension pcov');
|
|
19
|
-
expect(linux).toContain('remove_extension xdebug');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('checking addCoverage with PCOV on darwin', async () => {
|
|
23
|
-
const darwin: string = await coverage.addCoverage('pcov', '7.4', 'darwin');
|
|
24
|
-
expect(darwin).toContain('add_brew_extension pcov');
|
|
25
|
-
expect(darwin).toContain('remove_extension xdebug');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('checking addCoverage with Xdebug on windows', async () => {
|
|
29
|
-
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
|
|
30
|
-
expect(win32).toContain('Add-Extension xdebug');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('checking addCoverage with Xdebug3 on windows', async () => {
|
|
34
|
-
const win32: string = await coverage.addCoverage('xdebug3', '7.4', 'win32');
|
|
35
|
-
expect(win32).toContain('Add-Extension xdebug');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('checking addCoverage with Xdebug2 on windows', async () => {
|
|
39
|
-
const win32: string = await coverage.addCoverage('xdebug2', '7.4', 'win32');
|
|
40
|
-
expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('checking addCoverage with Xdebug on linux', async () => {
|
|
44
|
-
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
|
45
|
-
expect(linux).toContain('add_extension xdebug');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('checking addCoverage with Xdebug3 on linux', async () => {
|
|
49
|
-
const linux: string = await coverage.addCoverage('xdebug3', '8.0', 'linux');
|
|
50
|
-
expect(linux).toContain('add_extension xdebug');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('checking addCoverage with Xdebug2 on linux', async () => {
|
|
54
|
-
const linux: string = await coverage.addCoverage('xdebug2', '7.4', 'linux');
|
|
55
|
-
expect(linux).toContain('add_pecl_extension xdebug 2.9.8 zend_extension');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('checking addCoverage with Xdebug on darwin', async () => {
|
|
59
|
-
const darwin: string = await coverage.addCoverage(
|
|
60
|
-
'xdebug',
|
|
61
|
-
'7.4',
|
|
62
|
-
'darwin'
|
|
63
|
-
);
|
|
64
|
-
expect(darwin).toContain('add_brew_extension xdebug');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('checking addCoverage with Xdebug3 on darwin', async () => {
|
|
68
|
-
const darwin: string = await coverage.addCoverage(
|
|
69
|
-
'xdebug3',
|
|
70
|
-
'7.4',
|
|
71
|
-
'darwin'
|
|
72
|
-
);
|
|
73
|
-
expect(darwin).toContain('add_brew_extension xdebug');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('checking addCoverage with Xdebug2 on darwin', async () => {
|
|
77
|
-
const darwin: string = await coverage.addCoverage(
|
|
78
|
-
'xdebug2',
|
|
79
|
-
'7.4',
|
|
80
|
-
'darwin'
|
|
81
|
-
);
|
|
82
|
-
expect(darwin).toContain('add_brew_extension xdebug2');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('checking disableCoverage windows', async () => {
|
|
86
|
-
const win32 = await coverage.addCoverage('none', '7.4', 'win32');
|
|
87
|
-
expect(win32).toContain('Remove-Extension xdebug');
|
|
88
|
-
expect(win32).toContain('Remove-Extension pcov');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('checking disableCoverage on linux', async () => {
|
|
92
|
-
const linux: string = await coverage.addCoverage('none', '7.4', 'linux');
|
|
93
|
-
expect(linux).toContain('remove_extension xdebug');
|
|
94
|
-
expect(linux).toContain('remove_extension pcov');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('checking disableCoverage on darwin', async () => {
|
|
98
|
-
const darwin: string = await coverage.addCoverage('none', '7.4', 'darwin');
|
|
99
|
-
expect(darwin).toContain('remove_extension xdebug');
|
|
100
|
-
expect(darwin).toContain('remove_extension pcov');
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('checking no or invalid coverage driver', async () => {
|
|
104
|
-
let nocov: string = await coverage.addCoverage('nocov', '7.x', 'any');
|
|
105
|
-
expect(nocov).toEqual('');
|
|
106
|
-
|
|
107
|
-
nocov = await coverage.addCoverage('', '7.x', 'any');
|
|
108
|
-
expect(nocov).toEqual('');
|
|
109
|
-
});
|
|
110
|
-
});
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import * as extensions from '../src/extensions';
|
|
2
|
-
|
|
3
|
-
describe('Extension tests', () => {
|
|
4
|
-
it('checking addExtensionOnWindows', async () => {
|
|
5
|
-
let win32: string = await extensions.addExtension(
|
|
6
|
-
'Xdebug, pcov, sqlite, :intl, phalcon4, pecl_http, ioncube, oci8, pdo_oci, ast-beta, grpc-1.2.3, inotify-1.2.3alpha2, sqlsrv-1.2.3preview1',
|
|
7
|
-
'7.4',
|
|
8
|
-
'win32'
|
|
9
|
-
);
|
|
10
|
-
expect(win32).toContain('Add-Extension xdebug');
|
|
11
|
-
expect(win32).toContain('Add-Extension pcov');
|
|
12
|
-
expect(win32).toContain('Add-Extension sqlite3');
|
|
13
|
-
expect(win32).toContain('Remove-Extension intl');
|
|
14
|
-
expect(win32).toContain('Add-Phalcon phalcon4');
|
|
15
|
-
expect(win32).toContain('Add-Http');
|
|
16
|
-
expect(win32).toContain('Add-Ioncube');
|
|
17
|
-
expect(win32).toContain('Add-Oci oci8');
|
|
18
|
-
expect(win32).toContain('Add-Oci pdo_oci');
|
|
19
|
-
expect(win32).toContain('Add-Extension ast beta');
|
|
20
|
-
expect(win32).toContain('Add-Extension grpc stable 1.2.3');
|
|
21
|
-
expect(win32).toContain('Add-Extension inotify alpha 1.2.3');
|
|
22
|
-
expect(win32).toContain('Add-Extension sqlsrv devel 1.2.3');
|
|
23
|
-
|
|
24
|
-
win32 = await extensions.addExtension('pcov', '5.6', 'win32');
|
|
25
|
-
expect(win32).toContain(
|
|
26
|
-
'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
win32 = await extensions.addExtension('xdebug2', '7.2', 'win32');
|
|
30
|
-
expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
|
|
31
|
-
|
|
32
|
-
win32 = await extensions.addExtension('mysql', '7.4', 'win32');
|
|
33
|
-
expect(win32).toContain('Add-Extension mysqli');
|
|
34
|
-
expect(win32).toContain('Add-Extension mysqlnd');
|
|
35
|
-
|
|
36
|
-
win32 = await extensions.addExtension('mysql', '8.0', 'win32');
|
|
37
|
-
expect(win32).toContain('Add-Extension mysqli');
|
|
38
|
-
expect(win32).toContain('Add-Extension mysqlnd');
|
|
39
|
-
|
|
40
|
-
win32 = await extensions.addExtension('mysql', '5.5', 'win32');
|
|
41
|
-
expect(win32).toContain('Add-Extension mysql');
|
|
42
|
-
expect(win32).toContain('Add-Extension mysqli');
|
|
43
|
-
expect(win32).toContain('Add-Extension mysqlnd');
|
|
44
|
-
|
|
45
|
-
win32 = await extensions.addExtension(
|
|
46
|
-
'phalcon3, does_not_exist',
|
|
47
|
-
'7.2',
|
|
48
|
-
'win32',
|
|
49
|
-
true
|
|
50
|
-
);
|
|
51
|
-
expect(win32).toContain('Add-Phalcon phalcon3');
|
|
52
|
-
expect(win32).toContain('Add-Extension does_not_exist');
|
|
53
|
-
|
|
54
|
-
win32 = await extensions.addExtension('xdebug', '7.2', 'openbsd');
|
|
55
|
-
expect(win32).toContain('Platform openbsd is not supported');
|
|
56
|
-
|
|
57
|
-
win32 = await extensions.addExtension('blackfire', '7.3', 'win32');
|
|
58
|
-
expect(win32).toContain('Add-Blackfire blackfire');
|
|
59
|
-
|
|
60
|
-
win32 = await extensions.addExtension('blackfire-1.31.0', '7.3', 'win32');
|
|
61
|
-
expect(win32).toContain('Add-Blackfire blackfire-1.31.0');
|
|
62
|
-
|
|
63
|
-
win32 = await extensions.addExtension(
|
|
64
|
-
'mongodb-mongodb/mongo-php-driver@master',
|
|
65
|
-
'7.3',
|
|
66
|
-
'win32'
|
|
67
|
-
);
|
|
68
|
-
expect(win32).toContain(
|
|
69
|
-
'Add-Log "$cross" "mongodb-mongodb/mongo-php-driver@master" "mongodb-mongodb/mongo-php-driver@master is not supported on PHP 7.3"'
|
|
70
|
-
);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('checking addExtensionOnLinux', async () => {
|
|
74
|
-
let linux: string = await extensions.addExtension(
|
|
75
|
-
'Xdebug, pcov, sqlite, :intl, ast, ast-beta, pdo_mysql, pdo-odbc, xdebug-alpha, grpc-1.2.3',
|
|
76
|
-
'7.4',
|
|
77
|
-
'linux'
|
|
78
|
-
);
|
|
79
|
-
expect(linux).toContain('add_extension xdebug');
|
|
80
|
-
expect(linux).toContain('add_extension sqlite3');
|
|
81
|
-
expect(linux).toContain('remove_extension intl');
|
|
82
|
-
expect(linux).toContain('add_unstable_extension ast beta extension');
|
|
83
|
-
expect(linux).toContain('add_pdo_extension mysql');
|
|
84
|
-
expect(linux).toContain('add_pdo_extension odbc');
|
|
85
|
-
expect(linux).toContain('add_pecl_extension grpc 1.2.3 extension');
|
|
86
|
-
expect(linux).toContain(
|
|
87
|
-
'add_unstable_extension xdebug alpha zend_extension'
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
linux = await extensions.addExtension('pcov', '5.6', 'linux');
|
|
91
|
-
expect(linux).toContain(
|
|
92
|
-
'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
linux = await extensions.addExtension('gearman', '5.6', 'linux');
|
|
96
|
-
expect(linux).toContain('add_gearman');
|
|
97
|
-
linux = await extensions.addExtension('gearman', '7.4', 'linux');
|
|
98
|
-
expect(linux).toContain('add_gearman');
|
|
99
|
-
|
|
100
|
-
linux = await extensions.addExtension('couchbase', '5.6', 'linux');
|
|
101
|
-
expect(linux).toContain('add_couchbase');
|
|
102
|
-
linux = await extensions.addExtension('couchbase', '7.4', 'linux');
|
|
103
|
-
expect(linux).toContain('add_couchbase');
|
|
104
|
-
|
|
105
|
-
linux = await extensions.addExtension('pdo_cubrid', '7.0', 'linux');
|
|
106
|
-
expect(linux).toContain('add_cubrid pdo_cubrid');
|
|
107
|
-
linux = await extensions.addExtension('cubrid', '7.4', 'linux');
|
|
108
|
-
expect(linux).toContain('add_cubrid cubrid');
|
|
109
|
-
|
|
110
|
-
linux = await extensions.addExtension('xdebug2', '7.2', 'linux');
|
|
111
|
-
expect(linux).toContain('add_pecl_extension xdebug 2.9.8 zend_extension');
|
|
112
|
-
|
|
113
|
-
linux = await extensions.addExtension('xdebug', '7.2', 'openbsd');
|
|
114
|
-
expect(linux).toContain('Platform openbsd is not supported');
|
|
115
|
-
|
|
116
|
-
linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
|
|
117
|
-
expect(linux).toContain('add_phalcon phalcon3');
|
|
118
|
-
expect(linux).toContain('add_phalcon phalcon4');
|
|
119
|
-
|
|
120
|
-
linux = await extensions.addExtension('ioncube', '7.3', 'linux');
|
|
121
|
-
expect(linux).toContain('add_ioncube');
|
|
122
|
-
|
|
123
|
-
linux = await extensions.addExtension('geos', '7.3', 'linux');
|
|
124
|
-
expect(linux).toContain('add_geos');
|
|
125
|
-
|
|
126
|
-
linux = await extensions.addExtension('pecl_http', '7.3', 'linux');
|
|
127
|
-
expect(linux).toContain('add_http');
|
|
128
|
-
|
|
129
|
-
linux = await extensions.addExtension('http-1.2.3', '7.3', 'linux');
|
|
130
|
-
expect(linux).toContain('add_http http-1.2.3');
|
|
131
|
-
|
|
132
|
-
linux = await extensions.addExtension('oci8, pdo_oci', '7.3', 'linux');
|
|
133
|
-
expect(linux).toContain('add_oci oci8');
|
|
134
|
-
expect(linux).toContain('add_oci pdo_oci');
|
|
135
|
-
|
|
136
|
-
linux = await extensions.addExtension('blackfire', '7.3', 'linux');
|
|
137
|
-
expect(linux).toContain('add_blackfire blackfire');
|
|
138
|
-
|
|
139
|
-
linux = await extensions.addExtension('blackfire-1.31.0', '7.3', 'linux');
|
|
140
|
-
expect(linux).toContain('add_blackfire blackfire-1.31.0');
|
|
141
|
-
|
|
142
|
-
linux = await extensions.addExtension('intl-65.1', '5.6', 'linux');
|
|
143
|
-
expect(linux).toContain('add_intl intl-65.1');
|
|
144
|
-
|
|
145
|
-
linux = await extensions.addExtension('intl-67.1', '7.3', 'linux');
|
|
146
|
-
expect(linux).toContain('add_intl intl-67.1');
|
|
147
|
-
|
|
148
|
-
linux = await extensions.addExtension('intl-68.2', '8.0', 'linux');
|
|
149
|
-
expect(linux).toContain('add_intl intl-68.2');
|
|
150
|
-
|
|
151
|
-
linux = await extensions.addExtension(
|
|
152
|
-
'mongodb-mongodb/mongo-php-driver@master',
|
|
153
|
-
'7.3',
|
|
154
|
-
'linux'
|
|
155
|
-
);
|
|
156
|
-
expect(linux).toContain(
|
|
157
|
-
'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'
|
|
158
|
-
);
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it('checking addExtensionOnDarwin', async () => {
|
|
162
|
-
let darwin: string = await extensions.addExtension(
|
|
163
|
-
'amqp, apcu, Xdebug, pcov, grpc, igbinary, imagick, imap, memcache, memcached, mongodb, msgpack, phalcon3, phalcon4, protobuf, psr, rdkafka, redis, swoole, yaml, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
|
|
164
|
-
'7.2',
|
|
165
|
-
'darwin'
|
|
166
|
-
);
|
|
167
|
-
expect(darwin).toContain('add_brew_extension amqp extension');
|
|
168
|
-
expect(darwin).toContain('add_brew_extension apcu extension');
|
|
169
|
-
expect(darwin).toContain('add_brew_extension xdebug zend_extension');
|
|
170
|
-
expect(darwin).toContain('add_brew_extension pcov extension');
|
|
171
|
-
expect(darwin).toContain('add_brew_extension grpc extension');
|
|
172
|
-
expect(darwin).toContain('add_brew_extension igbinary extension');
|
|
173
|
-
expect(darwin).toContain('add_brew_extension imagick extension');
|
|
174
|
-
expect(darwin).toContain('add_brew_extension imap extension');
|
|
175
|
-
expect(darwin).toContain('add_brew_extension memcache extension');
|
|
176
|
-
expect(darwin).toContain('add_brew_extension memcached extension');
|
|
177
|
-
expect(darwin).toContain('add_brew_extension mongodb extension');
|
|
178
|
-
expect(darwin).toContain('add_brew_extension msgpack extension');
|
|
179
|
-
expect(darwin).toContain('add_brew_extension phalcon3 extension');
|
|
180
|
-
expect(darwin).toContain('add_brew_extension phalcon4 extension');
|
|
181
|
-
expect(darwin).toContain('add_brew_extension protobuf extension');
|
|
182
|
-
expect(darwin).toContain('add_brew_extension psr extension');
|
|
183
|
-
expect(darwin).toContain('add_brew_extension rdkafka extension');
|
|
184
|
-
expect(darwin).toContain('add_brew_extension redis extension');
|
|
185
|
-
expect(darwin).toContain('add_brew_extension swoole extension');
|
|
186
|
-
expect(darwin).toContain('add_brew_extension yaml extension');
|
|
187
|
-
expect(darwin).toContain('add_extension sqlite3');
|
|
188
|
-
expect(darwin).toContain('remove_extension intl');
|
|
189
|
-
expect(darwin).toContain('add_unstable_extension ast beta extension');
|
|
190
|
-
expect(darwin).toContain('add_pecl_extension grpc 1.2.3 extension');
|
|
191
|
-
|
|
192
|
-
darwin = await extensions.addExtension('couchbase', '5.6', 'darwin');
|
|
193
|
-
expect(darwin).toContain('add_couchbase');
|
|
194
|
-
|
|
195
|
-
darwin = await extensions.addExtension('couchbase', '7.3', 'darwin');
|
|
196
|
-
expect(darwin).toContain('add_couchbase');
|
|
197
|
-
|
|
198
|
-
darwin = await extensions.addExtension('ioncube', '7.3', 'darwin');
|
|
199
|
-
expect(darwin).toContain('add_ioncube');
|
|
200
|
-
|
|
201
|
-
darwin = await extensions.addExtension('geos', '7.3', 'darwin');
|
|
202
|
-
expect(darwin).toContain('add_geos');
|
|
203
|
-
|
|
204
|
-
darwin = await extensions.addExtension('pecl_http', '7.3', 'darwin');
|
|
205
|
-
expect(darwin).toContain('add_http');
|
|
206
|
-
|
|
207
|
-
darwin = await extensions.addExtension('http-1.2.3', '7.3', 'darwin');
|
|
208
|
-
expect(darwin).toContain('add_http http-1.2.3');
|
|
209
|
-
|
|
210
|
-
darwin = await extensions.addExtension('oci8, pdo_oci', '7.3', 'darwin');
|
|
211
|
-
expect(darwin).toContain('add_oci oci8');
|
|
212
|
-
expect(darwin).toContain('add_oci pdo_oci');
|
|
213
|
-
|
|
214
|
-
darwin = await extensions.addExtension('pcov', '5.6', 'darwin');
|
|
215
|
-
expect(darwin).toContain(
|
|
216
|
-
'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
|
|
217
|
-
);
|
|
218
|
-
|
|
219
|
-
darwin = await extensions.addExtension('pcov', '7.2', 'darwin');
|
|
220
|
-
expect(darwin).toContain('add_brew_extension pcov');
|
|
221
|
-
|
|
222
|
-
darwin = await extensions.addExtension('xdebug', '5.6', 'darwin');
|
|
223
|
-
expect(darwin).toContain('add_brew_extension xdebug');
|
|
224
|
-
|
|
225
|
-
darwin = await extensions.addExtension('xdebug', '7.0', 'darwin');
|
|
226
|
-
expect(darwin).toContain('add_brew_extension xdebug');
|
|
227
|
-
|
|
228
|
-
darwin = await extensions.addExtension('xdebug', '7.2', 'darwin');
|
|
229
|
-
expect(darwin).toContain('add_brew_extension xdebug');
|
|
230
|
-
|
|
231
|
-
darwin = await extensions.addExtension('xdebug2', '7.2', 'darwin');
|
|
232
|
-
expect(darwin).toContain('add_brew_extension xdebug2');
|
|
233
|
-
|
|
234
|
-
darwin = await extensions.addExtension('imagick', '5.5', 'darwin');
|
|
235
|
-
expect(darwin).toContain('add_extension imagick');
|
|
236
|
-
|
|
237
|
-
darwin = await extensions.addExtension('blackfire', '7.3', 'darwin');
|
|
238
|
-
expect(darwin).toContain('add_blackfire blackfire');
|
|
239
|
-
|
|
240
|
-
darwin = await extensions.addExtension('blackfire-1.31.0', '7.3', 'darwin');
|
|
241
|
-
expect(darwin).toContain('add_blackfire blackfire-1.31.0');
|
|
242
|
-
|
|
243
|
-
darwin = await extensions.addExtension(
|
|
244
|
-
'does_not_exist',
|
|
245
|
-
'7.2',
|
|
246
|
-
'darwin',
|
|
247
|
-
false
|
|
248
|
-
);
|
|
249
|
-
expect(darwin).toContain('add_extension does_not_exist');
|
|
250
|
-
|
|
251
|
-
darwin = await extensions.addExtension('xdebug', '7.2', 'openbsd');
|
|
252
|
-
expect(darwin).toContain('Platform openbsd is not supported');
|
|
253
|
-
|
|
254
|
-
darwin = await extensions.addExtension(
|
|
255
|
-
'mongodb-mongodb/mongo-php-driver@master',
|
|
256
|
-
'7.3',
|
|
257
|
-
'darwin'
|
|
258
|
-
);
|
|
259
|
-
expect(darwin).toContain(
|
|
260
|
-
'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'
|
|
261
|
-
);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import * as install from '../src/install';
|
|
2
|
-
import * as utils from '../src/utils';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Mock install.ts
|
|
6
|
-
*/
|
|
7
|
-
jest.mock('../src/install', () => ({
|
|
8
|
-
getScript: jest
|
|
9
|
-
.fn()
|
|
10
|
-
.mockImplementation(
|
|
11
|
-
async (
|
|
12
|
-
filename: string,
|
|
13
|
-
version: string,
|
|
14
|
-
os_version: string
|
|
15
|
-
): Promise<string> => {
|
|
16
|
-
const extension_csv: string = process.env['extensions'] || '';
|
|
17
|
-
const ini_values_csv: string = process.env['ini-values'] || '';
|
|
18
|
-
const coverage_driver: string = process.env['coverage'] || '';
|
|
19
|
-
let tools_csv: string = process.env['tools'] || '';
|
|
20
|
-
const pecl: string = process.env['pecl'] || '';
|
|
21
|
-
if (pecl == 'true') {
|
|
22
|
-
tools_csv = 'pecl, ' + tools_csv;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let script = 'initial script ' + filename + version + os_version;
|
|
26
|
-
if (tools_csv) {
|
|
27
|
-
script += 'add_tool';
|
|
28
|
-
}
|
|
29
|
-
if (extension_csv) {
|
|
30
|
-
script += 'install extensions';
|
|
31
|
-
}
|
|
32
|
-
if (coverage_driver) {
|
|
33
|
-
script += 'set coverage driver';
|
|
34
|
-
}
|
|
35
|
-
if (ini_values_csv) {
|
|
36
|
-
script += 'edit php.ini';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return script;
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
run: jest.fn().mockImplementation(async (): Promise<string> => {
|
|
43
|
-
const os_version: string = process.env['RUNNER_OS'] || '';
|
|
44
|
-
const version: string = await utils.parseVersion(
|
|
45
|
-
await utils.getInput('php-version', true)
|
|
46
|
-
);
|
|
47
|
-
const tool = await utils.scriptTool(os_version);
|
|
48
|
-
const filename = os_version + (await utils.scriptExtension(os_version));
|
|
49
|
-
return [
|
|
50
|
-
await install.getScript(filename, version, os_version),
|
|
51
|
-
tool,
|
|
52
|
-
filename,
|
|
53
|
-
version,
|
|
54
|
-
__dirname
|
|
55
|
-
].join(' ');
|
|
56
|
-
})
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Function to set the process.env
|
|
61
|
-
*
|
|
62
|
-
* @param version
|
|
63
|
-
* @param os
|
|
64
|
-
* @param extension_csv
|
|
65
|
-
* @param ini_values_csv
|
|
66
|
-
* @param coverage_driver
|
|
67
|
-
* @param tools
|
|
68
|
-
*/
|
|
69
|
-
function setEnv(
|
|
70
|
-
version: string | number,
|
|
71
|
-
os: string,
|
|
72
|
-
extension_csv: string,
|
|
73
|
-
ini_values_csv: string,
|
|
74
|
-
coverage_driver: string,
|
|
75
|
-
tools: string
|
|
76
|
-
): void {
|
|
77
|
-
process.env['php-version'] = version.toString();
|
|
78
|
-
process.env['RUNNER_OS'] = os;
|
|
79
|
-
process.env['extensions'] = extension_csv;
|
|
80
|
-
process.env['ini-values'] = ini_values_csv;
|
|
81
|
-
process.env['coverage'] = coverage_driver;
|
|
82
|
-
process.env['tools'] = tools;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
describe('Install', () => {
|
|
86
|
-
it('Test install on windows', async () => {
|
|
87
|
-
setEnv('7.0', 'win32', '', '', '', '');
|
|
88
|
-
|
|
89
|
-
let script: string = '' + (await install.run());
|
|
90
|
-
expect(script).toContain('initial script');
|
|
91
|
-
expect(script).toContain('pwsh win32.ps1 7.0 ' + __dirname);
|
|
92
|
-
|
|
93
|
-
setEnv('7.3', 'win32', '', '', '', '');
|
|
94
|
-
|
|
95
|
-
script = '' + (await install.run());
|
|
96
|
-
expect(script).toContain('initial script');
|
|
97
|
-
expect(script).toContain('pwsh win32.ps1 7.3 ' + __dirname);
|
|
98
|
-
|
|
99
|
-
setEnv('7.3', 'win32', 'a, b', 'a=b', 'x', '');
|
|
100
|
-
|
|
101
|
-
script = '' + (await install.run());
|
|
102
|
-
expect(script).toContain('initial script');
|
|
103
|
-
expect(script).toContain('install extensions');
|
|
104
|
-
expect(script).toContain('edit php.ini');
|
|
105
|
-
expect(script).toContain('set coverage driver');
|
|
106
|
-
expect(script).toContain('pwsh win32.ps1 7.3 ' + __dirname);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('Test install on linux', async () => {
|
|
110
|
-
setEnv('7.3', 'linux', '', '', '', '');
|
|
111
|
-
|
|
112
|
-
let script: string = '' + (await install.run());
|
|
113
|
-
expect(script).toContain('initial script');
|
|
114
|
-
expect(script).toContain('bash linux.sh 7.3 ');
|
|
115
|
-
|
|
116
|
-
setEnv('latest', 'linux', '', '', '', '');
|
|
117
|
-
|
|
118
|
-
script = '' + (await install.run());
|
|
119
|
-
expect(script).toContain('initial script');
|
|
120
|
-
expect(script).toContain('bash linux.sh 8.0 ');
|
|
121
|
-
|
|
122
|
-
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit');
|
|
123
|
-
|
|
124
|
-
script = '' + (await install.run());
|
|
125
|
-
expect(script).toContain('initial script');
|
|
126
|
-
expect(script).toContain('install extensions');
|
|
127
|
-
expect(script).toContain('edit php.ini');
|
|
128
|
-
expect(script).toContain('set coverage driver');
|
|
129
|
-
expect(script).toContain('bash linux.sh 7.3');
|
|
130
|
-
expect(script).toContain('add_tool');
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('Test install on darwin', async () => {
|
|
134
|
-
setEnv('7.3', 'darwin', '', '', '', '');
|
|
135
|
-
|
|
136
|
-
let script: string = '' + (await install.run());
|
|
137
|
-
expect(script).toContain('initial script');
|
|
138
|
-
expect(script).toContain('bash darwin.sh 7.3 ' + __dirname);
|
|
139
|
-
|
|
140
|
-
setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '');
|
|
141
|
-
|
|
142
|
-
script = '' + (await install.run());
|
|
143
|
-
expect(script).toContain('initial script');
|
|
144
|
-
expect(script).toContain('install extensions');
|
|
145
|
-
expect(script).toContain('edit php.ini');
|
|
146
|
-
expect(script).toContain('set coverage driver');
|
|
147
|
-
expect(script).toContain('bash darwin.sh 7.3 ' + __dirname);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('Test malformed version inputs', async () => {
|
|
151
|
-
setEnv('7.4.1', 'darwin', '', '', '', '');
|
|
152
|
-
|
|
153
|
-
let script: string = '' + '' + (await install.run());
|
|
154
|
-
expect(script).toContain('initial script');
|
|
155
|
-
expect(script).toContain('bash darwin.sh 7.4 ' + __dirname);
|
|
156
|
-
|
|
157
|
-
setEnv(8.0, 'darwin', '', '', '', '');
|
|
158
|
-
|
|
159
|
-
script = '' + (await install.run());
|
|
160
|
-
expect(script).toContain('initial script');
|
|
161
|
-
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);
|
|
162
|
-
|
|
163
|
-
setEnv(8, 'darwin', '', '', '', '');
|
|
164
|
-
|
|
165
|
-
script = '' + (await install.run());
|
|
166
|
-
expect(script).toContain('initial script');
|
|
167
|
-
expect(script).toContain('bash darwin.sh 8.0 ' + __dirname);
|
|
168
|
-
|
|
169
|
-
setEnv(8.1, 'darwin', '', '', '', '');
|
|
170
|
-
|
|
171
|
-
script = '' + (await install.run());
|
|
172
|
-
expect(script).toContain('initial script');
|
|
173
|
-
expect(script).toContain('bash darwin.sh 8.1 ' + __dirname);
|
|
174
|
-
});
|
|
175
|
-
});
|