mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
22 lines
953 B
TypeScript
22 lines
953 B
TypeScript
import * as config from '../src/config';
|
|
|
|
describe('Config tests', () => {
|
|
it.each`
|
|
ini_values | os_version | output
|
|
${'a=b, c=d'} | ${'win32'} | ${'Add-Content "$php_dir\\php.ini" "a=b\nc=d"'}
|
|
${'a=b, c=d'} | ${'linux'} | ${'echo "a=b\nc=d" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'}
|
|
${'a=b, c=d'} | ${'darwin'} | ${'echo "a=b\nc=d" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'}
|
|
${'a=b & ~c'} | ${'win32'} | ${'Add-Content "$php_dir\\php.ini" "a=\'b & ~c\'"'}
|
|
${'a="~(b)"'} | ${'win32'} | ${'Add-Content "$php_dir\\php.ini" "a=\'~(b)\'"'}
|
|
${'a="b, c"'} | ${'win32'} | ${'Add-Content "$php_dir\\php.ini" "a=b, c"'}
|
|
${'a=b, c=d'} | ${'openbsd'} | ${'Platform openbsd is not supported'}
|
|
`(
|
|
'checking addINIValues on $os_version',
|
|
async ({ini_values, os_version, output}) => {
|
|
expect(await config.addINIValues(ini_values, os_version)).toContain(
|
|
output
|
|
);
|
|
}
|
|
);
|
|
});
|