Specify version in phpenmod and phpdismod

This commit is contained in:
Shivam Mathur 2019-10-11 13:14:59 +05:30
parent e755fb7a69
commit f7f5b1a7e1
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 21 additions and 9 deletions

View File

@ -27,7 +27,7 @@ describe('Config tests', () => {
let linux: string = await coverage.addCoverage('pcov', '7.4', 'linux'); let linux: string = await coverage.addCoverage('pcov', '7.4', 'linux');
expect(linux).toContain('addExtension pcov'); expect(linux).toContain('addExtension pcov');
expect(linux).toContain('sudo sed -i "/xdebug/d" $ini_file'); expect(linux).toContain('sudo sed -i "/xdebug/d" $ini_file');
expect(linux).toContain('sudo phpdismod xdebug'); expect(linux).toContain('sudo phpdismod -v 7.4 xdebug');
}); });
it('checking addCoverage with PCOV on darwin', async () => { it('checking addCoverage with PCOV on darwin', async () => {
@ -58,8 +58,8 @@ describe('Config tests', () => {
it('checking disableCoverage on linux', async () => { it('checking disableCoverage on linux', async () => {
let linux: string = await coverage.addCoverage('none', '7.4', 'linux'); let linux: string = await coverage.addCoverage('none', '7.4', 'linux');
expect(linux).toContain('sudo phpdismod xdebug'); expect(linux).toContain('sudo phpdismod -v 7.4 xdebug');
expect(linux).toContain('sudo phpdismod pcov'); expect(linux).toContain('sudo phpdismod -v 7.4 pcov');
expect(linux).toContain('sudo sed -i "/xdebug/d" $ini_file'); expect(linux).toContain('sudo sed -i "/xdebug/d" $ini_file');
expect(linux).toContain('sudo sed -i "/pcov/d" $ini_file'); expect(linux).toContain('sudo sed -i "/pcov/d" $ini_file');
}); });

View File

@ -57,7 +57,9 @@ function addCoveragePCOV(version, os_version) {
script += script +=
'if [ -e /etc/php/' + 'if [ -e /etc/php/' +
version + version +
'/mods-available/xdebug.ini ]; then sudo phpdismod xdebug; fi\n'; '/mods-available/xdebug.ini ]; then sudo phpdismod -v ' +
version +
' xdebug; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n'; script += 'sudo sed -i "/xdebug/d" $ini_file\n';
break; break;
case 'darwin': case 'darwin':
@ -89,11 +91,15 @@ function disableCoverage(version, os_version) {
script += script +=
'if [ -e /etc/php/' + 'if [ -e /etc/php/' +
version + version +
'/mods-available/xdebug.ini ]; then sudo phpdismod xdebug; fi\n'; '/mods-available/xdebug.ini ]; then sudo phpdismod -v ' +
version +
' xdebug; fi\n';
script += script +=
'if [ -e /etc/php/' + 'if [ -e /etc/php/' +
version + version +
'/mods-available/pcov.ini ]; then sudo phpdismod pcov; fi\n'; '/mods-available/pcov.ini ]; then sudo phpdismod -v ' +
version +
' pcov; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n'; script += 'sudo sed -i "/xdebug/d" $ini_file\n';
script += 'sudo sed -i "/pcov/d" $ini_file\n'; script += 'sudo sed -i "/pcov/d" $ini_file\n';
break; break;

View File

@ -56,7 +56,9 @@ export async function addCoveragePCOV(version: string, os_version: string) {
script += script +=
'if [ -e /etc/php/' + 'if [ -e /etc/php/' +
version + version +
'/mods-available/xdebug.ini ]; then sudo phpdismod xdebug; fi\n'; '/mods-available/xdebug.ini ]; then sudo phpdismod -v ' +
version +
' xdebug; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n'; script += 'sudo sed -i "/xdebug/d" $ini_file\n';
break; break;
case 'darwin': case 'darwin':
@ -98,11 +100,15 @@ export async function disableCoverage(version: string, os_version: string) {
script += script +=
'if [ -e /etc/php/' + 'if [ -e /etc/php/' +
version + version +
'/mods-available/xdebug.ini ]; then sudo phpdismod xdebug; fi\n'; '/mods-available/xdebug.ini ]; then sudo phpdismod -v ' +
version +
' xdebug; fi\n';
script += script +=
'if [ -e /etc/php/' + 'if [ -e /etc/php/' +
version + version +
'/mods-available/pcov.ini ]; then sudo phpdismod pcov; fi\n'; '/mods-available/pcov.ini ]; then sudo phpdismod -v ' +
version +
' pcov; fi\n';
script += 'sudo sed -i "/xdebug/d" $ini_file\n'; script += 'sudo sed -i "/xdebug/d" $ini_file\n';
script += 'sudo sed -i "/pcov/d" $ini_file\n'; script += 'sudo sed -i "/pcov/d" $ini_file\n';
break; break;