diff --git a/__tests__/coverage.test.ts b/__tests__/coverage.test.ts index 0de20bb8..8aa59590 100644 --- a/__tests__/coverage.test.ts +++ b/__tests__/coverage.test.ts @@ -27,7 +27,7 @@ describe('Config tests', () => { let linux: string = await coverage.addCoverage('pcov', '7.4', 'linux'); expect(linux).toContain('addExtension pcov'); 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 () => { @@ -58,8 +58,8 @@ describe('Config tests', () => { it('checking disableCoverage on linux', async () => { let linux: string = await coverage.addCoverage('none', '7.4', 'linux'); - expect(linux).toContain('sudo phpdismod xdebug'); - expect(linux).toContain('sudo phpdismod pcov'); + expect(linux).toContain('sudo phpdismod -v 7.4 xdebug'); + 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 "/pcov/d" $ini_file'); }); diff --git a/lib/coverage.js b/lib/coverage.js index df8264ae..3451c57b 100644 --- a/lib/coverage.js +++ b/lib/coverage.js @@ -57,7 +57,9 @@ function addCoveragePCOV(version, os_version) { script += 'if [ -e /etc/php/' + 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'; break; case 'darwin': @@ -89,11 +91,15 @@ function disableCoverage(version, os_version) { script += 'if [ -e /etc/php/' + version + - '/mods-available/xdebug.ini ]; then sudo phpdismod xdebug; fi\n'; + '/mods-available/xdebug.ini ]; then sudo phpdismod -v ' + + version + + ' xdebug; fi\n'; script += 'if [ -e /etc/php/' + 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 "/pcov/d" $ini_file\n'; break; diff --git a/src/coverage.ts b/src/coverage.ts index 998599a1..b349efbd 100644 --- a/src/coverage.ts +++ b/src/coverage.ts @@ -56,7 +56,9 @@ export async function addCoveragePCOV(version: string, os_version: string) { script += 'if [ -e /etc/php/' + 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'; break; case 'darwin': @@ -98,11 +100,15 @@ export async function disableCoverage(version: string, os_version: string) { script += 'if [ -e /etc/php/' + version + - '/mods-available/xdebug.ini ]; then sudo phpdismod xdebug; fi\n'; + '/mods-available/xdebug.ini ]; then sudo phpdismod -v ' + + version + + ' xdebug; fi\n'; script += 'if [ -e /etc/php/' + 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 "/pcov/d" $ini_file\n'; break;