mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
use brew_extensions config for testing add_brew_extension
This commit is contained in:
parent
fca0924fa9
commit
b971d8f4ad
@ -1,3 +1,4 @@
|
|||||||
|
import * as fs from 'fs';
|
||||||
import * as extensions from '../src/extensions';
|
import * as extensions from '../src/extensions';
|
||||||
|
|
||||||
describe('Extension tests', () => {
|
describe('Extension tests', () => {
|
||||||
@ -24,7 +25,7 @@ describe('Extension tests', () => {
|
|||||||
${'sqlsrv-1.2.3preview1'} | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
|
${'sqlsrv-1.2.3preview1'} | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
|
||||||
${'Xdebug'} | ${'7.4'} | ${'Add-Extension xdebug'}
|
${'Xdebug'} | ${'7.4'} | ${'Add-Extension xdebug'}
|
||||||
${'xdebug2'} | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
|
${'xdebug2'} | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
|
||||||
`(
|
`(
|
||||||
'checking addExtensionOnWindows for extension $extension on version $version',
|
'checking addExtensionOnWindows for extension $extension on version $version',
|
||||||
async ({extension, version, output}) => {
|
async ({extension, version, output}) => {
|
||||||
expect(
|
expect(
|
||||||
@ -74,7 +75,6 @@ describe('Extension tests', () => {
|
|||||||
extension | version | output
|
extension | version | output
|
||||||
${'none'} | ${'7.2'} | ${'disable_all_shared'}
|
${'none'} | ${'7.2'} | ${'disable_all_shared'}
|
||||||
${':intl'} | ${'7.2'} | ${'disable_extension intl'}
|
${':intl'} | ${'7.2'} | ${'disable_extension intl'}
|
||||||
${'amqp'} | ${'7.2'} | ${'add_brew_extension amqp extension'}
|
|
||||||
${'ast-beta'} | ${'7.2'} | ${'add_unstable_extension ast beta extension'}
|
${'ast-beta'} | ${'7.2'} | ${'add_unstable_extension ast beta extension'}
|
||||||
${'blackfire'} | ${'7.3'} | ${'add_blackfire blackfire'}
|
${'blackfire'} | ${'7.3'} | ${'add_blackfire blackfire'}
|
||||||
${'blackfire-1.31.0'} | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
|
${'blackfire-1.31.0'} | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
|
||||||
@ -88,14 +88,10 @@ describe('Extension tests', () => {
|
|||||||
${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.2'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
|
${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.2'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
|
||||||
${'oci8'} | ${'7.3'} | ${'add_oci oci8'}
|
${'oci8'} | ${'7.3'} | ${'add_oci oci8'}
|
||||||
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
||||||
${'pcov'} | ${'7.2'} | ${'add_brew_extension pcov'}
|
|
||||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||||
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
||||||
${'Xdebug'} | ${'7.2'} | ${'add_brew_extension xdebug zend_extension'}
|
`(
|
||||||
${'xdebug'} | ${'7.0'} | ${'add_brew_extension xdebug'}
|
|
||||||
${'xdebug2'} | ${'7.2'} | ${'add_brew_extension xdebug2'}
|
|
||||||
`(
|
|
||||||
'checking addExtensionOnDarwin for extension $extension on version $version',
|
'checking addExtensionOnDarwin for extension $extension on version $version',
|
||||||
async ({extension, version, output}) => {
|
async ({extension, version, output}) => {
|
||||||
expect(
|
expect(
|
||||||
@ -104,6 +100,30 @@ describe('Extension tests', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const data: string[][] = fs
|
||||||
|
.readFileSync('src/configs/brew_extensions')
|
||||||
|
.toString()
|
||||||
|
.split(/\r?\n/)
|
||||||
|
.filter(Boolean)
|
||||||
|
.map(line => {
|
||||||
|
const [formula, extension]: string[] = line.split('=');
|
||||||
|
const prefix: string =
|
||||||
|
extension == 'xdebug' ? 'zend_extension' : 'extension';
|
||||||
|
const output: string = fs.existsSync(`src/scripts/ext/${extension}.sh`)
|
||||||
|
? `add_${extension}`
|
||||||
|
: `add_brew_extension ${formula} ${prefix}`;
|
||||||
|
return [formula, '7.3', output];
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(data)(
|
||||||
|
'checking addExtensionOnDarwin for brew extension %s',
|
||||||
|
async (extension, version, output) => {
|
||||||
|
expect(
|
||||||
|
await extensions.addExtension(extension, version, 'darwin')
|
||||||
|
).toContain(output);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
extension | version | output
|
extension | version | output
|
||||||
${'xdebug'} | ${'7.2'} | ${'Platform openbsd is not supported'}
|
${'xdebug'} | ${'7.2'} | ${'Platform openbsd is not supported'}
|
||||||
|
Loading…
Reference in New Issue
Block a user