setup-php/__tests__/config.test.ts

53 lines
1.7 KiB
TypeScript
Raw Normal View History

2019-10-08 18:12:54 +05:30
import * as config from '../src/config';
describe('Config tests', () => {
it('checking addINIValuesOnWindows', async () => {
let win32: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'win32'
);
expect(win32).toContain(
2020-05-17 03:39:04 +05:30
'Add-Content "$php_dir\\php.ini" "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
2019-10-08 18:12:54 +05:30
);
win32 = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'openbsd'
2019-10-08 18:12:54 +05:30
);
expect(win32).toContain('Platform openbsd is not supported');
2019-10-08 18:12:54 +05:30
});
it('checking addINIValuesOnLinux', async () => {
let linux: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
2019-10-17 01:41:13 +05:30
'linux',
true
2019-10-08 18:12:54 +05:30
);
2019-10-11 04:41:25 +05:30
expect(linux).toContain(
2019-10-27 05:42:49 +05:30
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
2019-10-11 04:41:25 +05:30
);
2019-10-08 18:12:54 +05:30
linux = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'openbsd'
2019-10-08 18:12:54 +05:30
);
expect(linux).toContain('Platform openbsd is not supported');
2019-10-08 18:12:54 +05:30
});
it('checking addINIValuesOnDarwin', async () => {
let darwin: string = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'darwin'
);
2019-10-11 04:41:25 +05:30
expect(darwin).toContain(
2019-10-27 05:42:49 +05:30
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
2019-10-11 04:41:25 +05:30
);
2019-10-08 18:12:54 +05:30
darwin = await config.addINIValues(
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
'openbsd'
2019-10-08 18:12:54 +05:30
);
expect(darwin).toContain('Platform openbsd is not supported');
2019-10-08 18:12:54 +05:30
});
});