From 2cc925b6555069a3f3e7fd0ad4fbd02c141942ca Mon Sep 17 00:00:00 2001
From: Aneesh Relan <aneesh.relan@gmail.com>
Date: Wed, 6 Oct 2021 01:05:47 +0530
Subject: [PATCH 1/4] tests: refactor extensions test to use jest-each

---
 __tests__/extensions.test.ts | 222 ++++++++++-------------------------
 1 file changed, 65 insertions(+), 157 deletions(-)

diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index 9a9f54653..5812d4b42 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -1,163 +1,71 @@
 import * as extensions from '../src/extensions';
 
 describe('Extension tests', () => {
-  it('checking addExtensionOnWindows', async () => {
-    let win32: string = await extensions.addExtension(
-      'none, Xdebug, pcov, sqlite, :intl, phalcon4, pecl_http, ioncube, oci8, pdo_oci, ast-beta, grpc-1.2.3, inotify-1.2.3alpha2, sqlsrv-1.2.3preview1',
-      '7.4',
-      'win32'
-    );
-    expect(win32).toContain('Disable-AllShared');
-    expect(win32).toContain('Add-Extension xdebug');
-    expect(win32).toContain('Add-Extension pcov');
-    expect(win32).toContain('Add-Extension sqlite3');
-    expect(win32).toContain('Disable-Extension intl');
-    expect(win32).toContain('Add-Phalcon phalcon4');
-    expect(win32).toContain('Add-Http');
-    expect(win32).toContain('Add-Ioncube');
-    expect(win32).toContain('Add-Oci oci8');
-    expect(win32).toContain('Add-Oci pdo_oci');
-    expect(win32).toContain('Add-Extension ast beta');
-    expect(win32).toContain('Add-Extension grpc stable 1.2.3');
-    expect(win32).toContain('Add-Extension inotify alpha 1.2.3');
-    expect(win32).toContain('Add-Extension sqlsrv devel 1.2.3');
-
-    win32 = await extensions.addExtension('pcov', '5.6', 'win32');
-    expect(win32).toContain(
-      'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
-    );
-
-    win32 = await extensions.addExtension('xdebug2', '7.2', 'win32');
-    expect(win32).toContain('Add-Extension xdebug stable 2.9.8');
-
-    win32 = await extensions.addExtension('mysql', '7.4', 'win32');
-    expect(win32).toContain('Add-Extension mysqli');
-    expect(win32).toContain('Add-Extension mysqlnd');
-
-    win32 = await extensions.addExtension('mysql', '8.0', 'win32');
-    expect(win32).toContain('Add-Extension mysqli');
-    expect(win32).toContain('Add-Extension mysqlnd');
-
-    win32 = await extensions.addExtension('mysql', '5.5', 'win32');
-    expect(win32).toContain('Add-Extension mysql');
-    expect(win32).toContain('Add-Extension mysqli');
-    expect(win32).toContain('Add-Extension mysqlnd');
-
-    win32 = await extensions.addExtension(
-      'phalcon3, does_not_exist',
-      '7.2',
-      'win32',
-      true
-    );
-    expect(win32).toContain('Add-Phalcon phalcon3');
-    expect(win32).toContain('Add-Extension does_not_exist');
-
-    win32 = await extensions.addExtension('xdebug', '7.2', 'openbsd');
-    expect(win32).toContain('Platform openbsd is not supported');
-
-    win32 = await extensions.addExtension('blackfire', '7.3', 'win32');
-    expect(win32).toContain('Add-Blackfire blackfire');
-
-    win32 = await extensions.addExtension('blackfire-1.31.0', '7.3', 'win32');
-    expect(win32).toContain('Add-Blackfire blackfire-1.31.0');
-
-    win32 = await extensions.addExtension(
-      'mongodb-mongodb/mongo-php-driver@master',
-      '7.3',
-      'win32'
-    );
-    expect(win32).toContain(
-      'Add-Log "$cross" "mongodb-mongodb/mongo-php-driver@master" "mongodb-mongodb/mongo-php-driver@master is not supported on PHP 7.3"'
-    );
-  });
-
-  it('checking addExtensionOnLinux', async () => {
-    let linux: string = await extensions.addExtension(
-      'none, Xdebug, pcov, sqlite, :intl, ast, ast-beta, pdo_mysql, pdo-odbc, xdebug-alpha, grpc-1.2.3',
-      '7.4',
-      'linux'
-    );
-    expect(linux).toContain('disable_all_shared');
-    expect(linux).toContain('add_extension xdebug');
-    expect(linux).toContain('add_extension sqlite3');
-    expect(linux).toContain('disable_extension intl');
-    expect(linux).toContain('add_unstable_extension ast beta extension');
-    expect(linux).toContain('add_pdo_extension mysql');
-    expect(linux).toContain('add_pdo_extension odbc');
-    expect(linux).toContain('add_pecl_extension grpc 1.2.3 extension');
-    expect(linux).toContain(
-      'add_unstable_extension xdebug alpha zend_extension'
-    );
-
-    linux = await extensions.addExtension('pcov', '5.6', 'linux');
-    expect(linux).toContain(
-      'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
-    );
-
-    linux = await extensions.addExtension('gearman', '5.6', 'linux');
-    expect(linux).toContain('add_gearman');
-    linux = await extensions.addExtension('gearman', '7.4', 'linux');
-    expect(linux).toContain('add_gearman');
-
-    linux = await extensions.addExtension('couchbase', '5.6', 'linux');
-    expect(linux).toContain('add_couchbase');
-    linux = await extensions.addExtension('couchbase', '7.4', 'linux');
-    expect(linux).toContain('add_couchbase');
-
-    linux = await extensions.addExtension('pdo_cubrid', '7.0', 'linux');
-    expect(linux).toContain('add_cubrid pdo_cubrid');
-    linux = await extensions.addExtension('cubrid', '7.4', 'linux');
-    expect(linux).toContain('add_cubrid cubrid');
-
-    linux = await extensions.addExtension('xdebug2', '7.2', 'linux');
-    expect(linux).toContain('add_pecl_extension xdebug 2.9.8 zend_extension');
-
-    linux = await extensions.addExtension('xdebug', '7.2', 'openbsd');
-    expect(linux).toContain('Platform openbsd is not supported');
-
-    linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
-    expect(linux).toContain('add_phalcon phalcon3');
-    expect(linux).toContain('add_phalcon phalcon4');
-
-    linux = await extensions.addExtension('ioncube', '7.3', 'linux');
-    expect(linux).toContain('add_ioncube');
-
-    linux = await extensions.addExtension('geos', '7.3', 'linux');
-    expect(linux).toContain('add_geos');
-
-    linux = await extensions.addExtension('pecl_http', '7.3', 'linux');
-    expect(linux).toContain('add_http');
-
-    linux = await extensions.addExtension('http-1.2.3', '7.3', 'linux');
-    expect(linux).toContain('add_http http-1.2.3');
-
-    linux = await extensions.addExtension('oci8, pdo_oci', '7.3', 'linux');
-    expect(linux).toContain('add_oci oci8');
-    expect(linux).toContain('add_oci pdo_oci');
-
-    linux = await extensions.addExtension('blackfire', '7.3', 'linux');
-    expect(linux).toContain('add_blackfire blackfire');
-
-    linux = await extensions.addExtension('blackfire-1.31.0', '7.3', 'linux');
-    expect(linux).toContain('add_blackfire blackfire-1.31.0');
-
-    linux = await extensions.addExtension('intl-65.1', '5.6', 'linux');
-    expect(linux).toContain('add_intl intl-65.1');
-
-    linux = await extensions.addExtension('intl-67.1', '7.3', 'linux');
-    expect(linux).toContain('add_intl intl-67.1');
-
-    linux = await extensions.addExtension('intl-68.2', '8.0', 'linux');
-    expect(linux).toContain('add_intl intl-68.2');
-
-    linux = await extensions.addExtension(
-      'mongodb-mongodb/mongo-php-driver@master',
-      '7.3',
-      'linux'
-    );
-    expect(linux).toContain(
-      'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'
-    );
+  it.each`
+    extension                                    | version  | output
+    ${'none'}                                    | ${'7.4'} | ${'Disable-AllShared'}
+    ${'Xdebug'}                                  | ${'7.4'} | ${'Add-Extension xdebug'}
+    ${':intl'}                                   | ${'7.4'} | ${'Disable-Extension intl'}
+    ${'phalcon4'}                                | ${'7.4'} | ${'Add-Phalcon phalcon4'}
+    ${'pecl_http'}                               | ${'7.4'} | ${'Add-Http'}
+    ${'ioncube'}                                 | ${'7.4'} | ${'Add-Ioncube'}
+    ${'oci8'}                                    | ${'7.4'} | ${'Add-Oci oci8'}
+    ${'pdo_oci'}                                 | ${'7.4'} | ${'Add-Oci pdo_oci'}
+    ${'ast-beta'}                                | ${'7.4'} | ${'Add-Extension ast beta'}
+    ${'grpc-1.2.3'}                              | ${'7.4'} | ${'Add-Extension grpc stable 1.2.3'}
+    ${'inotify-1.2.3alpha2'}                     | ${'7.4'} | ${'Add-Extension inotify alpha 1.2.3'}
+    ${'sqlsrv-1.2.3preview1'}                    | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
+    ${'pcov'}                                    | ${'5.6'} | ${'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
+    ${'xdebug2'}                                 | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
+    ${'mysql'}                                   | ${'7.4'} | ${'Add-Extension mysqli'}
+    ${'mysql'}                                   | ${'7.4'} | ${'Add-Extension mysqlnd'}
+    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysql'}
+    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysqli'}
+    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysqlnd'}
+    ${'phalcon3'}                                | ${'7.2'} | ${'Add-Phalcon phalcon3'}
+    ${'blackfire'}                               | ${'7.3'} | ${'Add-Blackfire blackfire'}
+    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'Add-Blackfire blackfire-1.31.0'}
+    ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'Add-Log "$cross" "mongodb-mongodb/mongo-php-driver@master" "mongodb-mongodb/mongo-php-driver@master is not supported on PHP 7.3"'}
+  `(
+    'checking addExtensionOnWindows for extension $extension on version $version',
+    async ({extension, version, output}) => {
+      expect(
+        await extensions.addExtension(extension, version, 'win32')
+      ).toContain(output);
+    }
+  );
+
+  it.each`
+    extension                                    | version  | output
+    ${'none'}                                    | ${'7.4'} | ${'disable_all_shared'}
+    ${'Xdebug'}                                  | ${'7.4'} | ${'add_extension xdebug'}
+    ${':intl'}                                   | ${'7.4'} | ${'disable_extension intl'}
+    ${'ast-beta'}                                | ${'7.4'} | ${'add_unstable_extension ast beta extension'}
+    ${'pdo_mysql'}                               | ${'7.4'} | ${'add_pdo_extension mysql'}
+    ${'pdo-odbc'}                                | ${'7.4'} | ${'add_pdo_extension odbc'}
+    ${'grpc-1.2.3'}                              | ${'7.4'} | ${'add_pecl_extension grpc 1.2.3 extension'}
+    ${'xdebug-alpha'}                            | ${'7.4'} | ${'add_unstable_extension xdebug alpha zend_extension'}
+    ${'pcov'}                                    | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6'}
+    ${'gearman'}                                 | ${'5.6'} | ${'add_gearman'}
+    ${'gearman'}                                 | ${'7.4'} | ${'add_gearman'}
+    ${'couchbase'}                               | ${'5.6'} | ${'add_couchbase'}
+    ${'couchbase'}                               | ${'7.4'} | ${'add_couchbase'}
+    ${'pdo_cubrid'}                              | ${'7.0'} | ${'add_cubrid pdo_cubrid'}
+    ${'pdo_cubrid'}                              | ${'7.4'} | ${'add_pdo_extension cubrid'}
+    ${'xdebug2'}                                 | ${'7.2'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
+    ${'phalcon3'}                                | ${'7.3'} | ${'add_phalcon phalcon3'}
+    ${'ioncube'}                                 | ${'7.3'} | ${'add_ioncube'}
+    ${'geos'}                                    | ${'7.3'} | ${'add_geos'}
+    ${'pecl_http'}                               | ${'7.3'} | ${'add_http'}
+    ${'http-1.2.3'}                              | ${'7.3'} | ${'add_http http-1.2.3'}
+    ${'oci8'}                                    | ${'7.3'} | ${'add_oci oci8'}
+    ${'pdo_oci'}                                 | ${'7.3'} | ${'add_oci pdo_oci'}
+    ${'blackfire'}                               | ${'7.3'} | ${'add_blackfire blackfire'}
+    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
+    ${'intl-65.1'}                               | ${'5.6'} | ${'add_intl intl-65.1'}
+    ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
+  `('checking addExtensionOnLinux for extension $extension on version $version', async ({extension, version, output}) => {
+    expect(await extensions.addExtension(extension, version, 'linux')).toContain(output);
   });
 
   it('checking addExtensionOnDarwin', async () => {

From 5e33fdb0d9fa29ed9adda4f3f3f9c9359f93fe80 Mon Sep 17 00:00:00 2001
From: Aneesh Relan <aneesh.relan@gmail.com>
Date: Fri, 8 Oct 2021 20:02:42 +0530
Subject: [PATCH 2/4] tests: refactor extensions.test.ts to use jest.each

---
 __tests__/extensions.test.ts | 152 ++++++++++-------------------------
 1 file changed, 43 insertions(+), 109 deletions(-)

diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index 5812d4b42..ecbc0d140 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -64,114 +64,48 @@ describe('Extension tests', () => {
     ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
     ${'intl-65.1'}                               | ${'5.6'} | ${'add_intl intl-65.1'}
     ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
-  `('checking addExtensionOnLinux for extension $extension on version $version', async ({extension, version, output}) => {
-    expect(await extensions.addExtension(extension, version, 'linux')).toContain(output);
-  });
-
-  it('checking addExtensionOnDarwin', async () => {
-    let darwin: string = await extensions.addExtension(
-      'none, amqp, apcu, expect, Xdebug, pcov, grpc, igbinary, imagick, imap, memcache, memcached, mongodb, msgpack, phalcon3, phalcon4, protobuf, psr, rdkafka, redis, ssh2, swoole, vips, yaml, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
-      '7.2',
-      'darwin'
-    );
-    expect(darwin).toContain('disable_all_shared');
-    expect(darwin).toContain('add_brew_extension amqp extension');
-    expect(darwin).toContain('add_brew_extension apcu extension');
-    expect(darwin).toContain('add_brew_extension expect extension');
-    expect(darwin).toContain('add_brew_extension xdebug zend_extension');
-    expect(darwin).toContain('add_brew_extension pcov extension');
-    expect(darwin).toContain('add_brew_extension grpc extension');
-    expect(darwin).toContain('add_brew_extension igbinary extension');
-    expect(darwin).toContain('add_brew_extension imagick extension');
-    expect(darwin).toContain('add_brew_extension imap extension');
-    expect(darwin).toContain('add_brew_extension memcache extension');
-    expect(darwin).toContain('add_brew_extension memcached extension');
-    expect(darwin).toContain('add_brew_extension mongodb extension');
-    expect(darwin).toContain('add_brew_extension msgpack extension');
-    expect(darwin).toContain('add_brew_extension phalcon3 extension');
-    expect(darwin).toContain('add_brew_extension phalcon4 extension');
-    expect(darwin).toContain('add_brew_extension protobuf extension');
-    expect(darwin).toContain('add_brew_extension psr extension');
-    expect(darwin).toContain('add_brew_extension rdkafka extension');
-    expect(darwin).toContain('add_brew_extension redis extension');
-    expect(darwin).toContain('add_brew_extension ssh2 extension');
-    expect(darwin).toContain('add_brew_extension swoole extension');
-    expect(darwin).toContain('add_brew_extension vips extension');
-    expect(darwin).toContain('add_brew_extension yaml extension');
-    expect(darwin).toContain('add_extension sqlite3');
-    expect(darwin).toContain('disable_extension intl');
-    expect(darwin).toContain('add_unstable_extension ast beta extension');
-    expect(darwin).toContain('add_pecl_extension grpc 1.2.3 extension');
-
-    darwin = await extensions.addExtension('couchbase', '5.6', 'darwin');
-    expect(darwin).toContain('add_couchbase');
-
-    darwin = await extensions.addExtension('couchbase', '7.3', 'darwin');
-    expect(darwin).toContain('add_couchbase');
-
-    darwin = await extensions.addExtension('ioncube', '7.3', 'darwin');
-    expect(darwin).toContain('add_ioncube');
-
-    darwin = await extensions.addExtension('geos', '7.3', 'darwin');
-    expect(darwin).toContain('add_geos');
-
-    darwin = await extensions.addExtension('pecl_http', '7.3', 'darwin');
-    expect(darwin).toContain('add_http');
-
-    darwin = await extensions.addExtension('http-1.2.3', '7.3', 'darwin');
-    expect(darwin).toContain('add_http http-1.2.3');
-
-    darwin = await extensions.addExtension('oci8, pdo_oci', '7.3', 'darwin');
-    expect(darwin).toContain('add_oci oci8');
-    expect(darwin).toContain('add_oci pdo_oci');
-
-    darwin = await extensions.addExtension('pcov', '5.6', 'darwin');
-    expect(darwin).toContain(
-      'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
-    );
-
-    darwin = await extensions.addExtension('pcov', '7.2', 'darwin');
-    expect(darwin).toContain('add_brew_extension pcov');
-
-    darwin = await extensions.addExtension('xdebug', '5.6', 'darwin');
-    expect(darwin).toContain('add_brew_extension xdebug');
-
-    darwin = await extensions.addExtension('xdebug', '7.0', 'darwin');
-    expect(darwin).toContain('add_brew_extension xdebug');
-
-    darwin = await extensions.addExtension('xdebug', '7.2', 'darwin');
-    expect(darwin).toContain('add_brew_extension xdebug');
-
-    darwin = await extensions.addExtension('xdebug2', '7.2', 'darwin');
-    expect(darwin).toContain('add_brew_extension xdebug2');
-
-    darwin = await extensions.addExtension('imagick', '5.5', 'darwin');
-    expect(darwin).toContain('add_extension imagick');
-
-    darwin = await extensions.addExtension('blackfire', '7.3', 'darwin');
-    expect(darwin).toContain('add_blackfire blackfire');
-
-    darwin = await extensions.addExtension('blackfire-1.31.0', '7.3', 'darwin');
-    expect(darwin).toContain('add_blackfire blackfire-1.31.0');
-
-    darwin = await extensions.addExtension(
-      'does_not_exist',
-      '7.2',
-      'darwin',
-      false
-    );
-    expect(darwin).toContain('add_extension does_not_exist');
-
-    darwin = await extensions.addExtension('xdebug', '7.2', 'openbsd');
-    expect(darwin).toContain('Platform openbsd is not supported');
+  `(
+    'checking addExtensionOnLinux for extension $extension on version $version',
+    async ({extension, version, output}) => {
+      expect(
+        await extensions.addExtension(extension, version, 'linux')
+      ).toContain(output);
+    }
+  );
 
-    darwin = await extensions.addExtension(
-      'mongodb-mongodb/mongo-php-driver@master',
-      '7.3',
-      'darwin'
-    );
-    expect(darwin).toContain(
-      'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'
-    );
-  });
+  it.each`
+    extension                                    | version  | output
+    ${'none'}                                    | ${'7.2'} | ${'disable_all_shared'}
+    ${'amqp'}                                    | ${'7.2'} | ${'add_brew_extension amqp extension'}
+    ${'Xdebug'}                                  | ${'7.2'} | ${'add_brew_extension xdebug zend_extension'}
+    ${'sqlite'}                                  | ${'7.2'} | ${'add_extension sqlite3'}
+    ${':intl'}                                   | ${'7.2'} | ${'disable_extension intl'}
+    ${'ast-beta'}                                | ${'7.2'} | ${'add_unstable_extension ast beta extension'}
+    ${'grpc-1.2.3'}                              | ${'7.2'} | ${'add_pecl_extension grpc 1.2.3 extension'}
+    ${'couchbase'}                               | ${'5.6'} | ${'add_couchbase'}
+    ${'couchbase'}                               | ${'7.3'} | ${'add_couchbase'}
+    ${'ioncube'}                                 | ${'7.3'} | ${'add_ioncube'}
+    ${'geos'}                                    | ${'7.3'} | ${'add_geos'}
+    ${'pecl_http'}                               | ${'7.3'} | ${'add_http'}
+    ${'http-1.2.3'}                              | ${'7.3'} | ${'add_http http-1.2.3'}
+    ${'oci8'}                                    | ${'7.3'} | ${'add_oci oci8'}
+    ${'pdo_oci'}                                 | ${'7.3'} | ${'add_oci pdo_oci'}
+    ${'pcov'}                                    | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
+    ${'pcov'}                                    | ${'7.2'} | ${'add_brew_extension pcov'}
+    ${'xdebug'}                                  | ${'5.6'} | ${'add_brew_extension xdebug'}
+    ${'xdebug'}                                  | ${'7.0'} | ${'add_brew_extension xdebug'}
+    ${'xdebug2'}                                 | ${'7.2'} | ${'add_brew_extension xdebug2'}
+    ${'imagick'}                                 | ${'5.5'} | ${'add_extension imagick'}
+    ${'blackfire'}                               | ${'7.3'} | ${'add_blackfire blackfire'}
+    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
+    ${'does_not_exist'}                          | ${'7.2'} | ${'add_extension does_not_exist'}
+    ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.2'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
+  `(
+    'checking addExtensionOnDarwin for extension $extension on version $version',
+    async ({extension, version, output}) => {
+      expect(
+        await extensions.addExtension(extension, version, 'darwin')
+      ).toContain(output);
+    }
+  );
 });

From 705c2a5785221c51126a67ea65ccd1bc4bb8bccd Mon Sep 17 00:00:00 2001
From: Aneesh Relan <aneesh.relan@gmail.com>
Date: Fri, 8 Oct 2021 20:28:41 +0530
Subject: [PATCH 3/4] tests: increase test coverage for extensions.test.ts

---
 __tests__/extensions.test.ts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index ecbc0d140..149c54b12 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -5,6 +5,7 @@ describe('Extension tests', () => {
     extension                                    | version  | output
     ${'none'}                                    | ${'7.4'} | ${'Disable-AllShared'}
     ${'Xdebug'}                                  | ${'7.4'} | ${'Add-Extension xdebug'}
+    ${'sqlite'}                                  | ${'7.4'} | ${'Add-Extension sqlite3'}
     ${':intl'}                                   | ${'7.4'} | ${'Disable-Extension intl'}
     ${'phalcon4'}                                | ${'7.4'} | ${'Add-Phalcon phalcon4'}
     ${'pecl_http'}                               | ${'7.4'} | ${'Add-Http'}
@@ -39,6 +40,7 @@ describe('Extension tests', () => {
     extension                                    | version  | output
     ${'none'}                                    | ${'7.4'} | ${'disable_all_shared'}
     ${'Xdebug'}                                  | ${'7.4'} | ${'add_extension xdebug'}
+    ${'sqlite'}                                  | ${'7.4'} | ${'add_extension sqlite3'}
     ${':intl'}                                   | ${'7.4'} | ${'disable_extension intl'}
     ${'ast-beta'}                                | ${'7.4'} | ${'add_unstable_extension ast beta extension'}
     ${'pdo_mysql'}                               | ${'7.4'} | ${'add_pdo_extension mysql'}
@@ -108,4 +110,16 @@ describe('Extension tests', () => {
       ).toContain(output);
     }
   );
+
+  it.each`
+    extension   | version  | output
+    ${'xdebug'} | ${'7.2'} | ${'Platform openbsd is not supported'}
+  `(
+    'checking addExtension on openbsd for extension $extension on version $version',
+    async ({extension, version, output}) => {
+      expect(
+        await extensions.addExtension(extension, version, 'openbsd')
+      ).toContain(output);
+    }
+  );
 });

From f2d6820ca296a5d43350cea647ca8abd8b473b40 Mon Sep 17 00:00:00 2001
From: Aneesh Relan <aneesh.relan@gmail.com>
Date: Fri, 8 Oct 2021 22:24:17 +0530
Subject: [PATCH 4/4] tests: sort test data in alphabetic order and merge
 duplicates

---
 __tests__/extensions.test.ts | 99 +++++++++++++++++-------------------
 1 file changed, 46 insertions(+), 53 deletions(-)

diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts
index 149c54b12..38f76c860 100644
--- a/__tests__/extensions.test.ts
+++ b/__tests__/extensions.test.ts
@@ -4,30 +4,27 @@ describe('Extension tests', () => {
   it.each`
     extension                                    | version  | output
     ${'none'}                                    | ${'7.4'} | ${'Disable-AllShared'}
-    ${'Xdebug'}                                  | ${'7.4'} | ${'Add-Extension xdebug'}
-    ${'sqlite'}                                  | ${'7.4'} | ${'Add-Extension sqlite3'}
     ${':intl'}                                   | ${'7.4'} | ${'Disable-Extension intl'}
-    ${'phalcon4'}                                | ${'7.4'} | ${'Add-Phalcon phalcon4'}
-    ${'pecl_http'}                               | ${'7.4'} | ${'Add-Http'}
-    ${'ioncube'}                                 | ${'7.4'} | ${'Add-Ioncube'}
-    ${'oci8'}                                    | ${'7.4'} | ${'Add-Oci oci8'}
-    ${'pdo_oci'}                                 | ${'7.4'} | ${'Add-Oci pdo_oci'}
     ${'ast-beta'}                                | ${'7.4'} | ${'Add-Extension ast beta'}
+    ${'blackfire'}                               | ${'7.3'} | ${'Add-Blackfire blackfire'}
+    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'Add-Blackfire blackfire-1.31.0'}
     ${'grpc-1.2.3'}                              | ${'7.4'} | ${'Add-Extension grpc stable 1.2.3'}
     ${'inotify-1.2.3alpha2'}                     | ${'7.4'} | ${'Add-Extension inotify alpha 1.2.3'}
-    ${'sqlsrv-1.2.3preview1'}                    | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
+    ${'ioncube'}                                 | ${'7.4'} | ${'Add-Ioncube'}
+    ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'Add-Log "$cross" "mongodb-mongodb/mongo-php-driver@master" "mongodb-mongodb/mongo-php-driver@master is not supported on PHP 7.3"'}
+    ${'mysql'}                                   | ${'7.4'} | ${'Add-Extension mysqli\nAdd-Extension mysqlnd'}
+    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd'}
+    ${'oci8'}                                    | ${'7.4'} | ${'Add-Oci oci8'}
     ${'pcov'}                                    | ${'5.6'} | ${'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
-    ${'xdebug2'}                                 | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
-    ${'mysql'}                                   | ${'7.4'} | ${'Add-Extension mysqli'}
-    ${'mysql'}                                   | ${'7.4'} | ${'Add-Extension mysqlnd'}
-    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysql'}
-    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysqli'}
-    ${'mysql'}                                   | ${'5.5'} | ${'Add-Extension mysqlnd'}
+    ${'pdo_oci'}                                 | ${'7.4'} | ${'Add-Oci pdo_oci'}
+    ${'pecl_http'}                               | ${'7.4'} | ${'Add-Http'}
     ${'phalcon3'}                                | ${'7.2'} | ${'Add-Phalcon phalcon3'}
-    ${'blackfire'}                               | ${'7.3'} | ${'Add-Blackfire blackfire'}
-    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'Add-Blackfire blackfire-1.31.0'}
-    ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'Add-Log "$cross" "mongodb-mongodb/mongo-php-driver@master" "mongodb-mongodb/mongo-php-driver@master is not supported on PHP 7.3"'}
-  `(
+    ${'phalcon4'}                                | ${'7.4'} | ${'Add-Phalcon phalcon4'}
+    ${'sqlite'}                                  | ${'7.4'} | ${'Add-Extension sqlite3'}
+    ${'sqlsrv-1.2.3preview1'}                    | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
+    ${'Xdebug'}                                  | ${'7.4'} | ${'Add-Extension xdebug'}
+    ${'xdebug2'}                                 | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
+    `(
     'checking addExtensionOnWindows for extension $extension on version $version',
     async ({extension, version, output}) => {
       expect(
@@ -39,33 +36,31 @@ describe('Extension tests', () => {
   it.each`
     extension                                    | version  | output
     ${'none'}                                    | ${'7.4'} | ${'disable_all_shared'}
-    ${'Xdebug'}                                  | ${'7.4'} | ${'add_extension xdebug'}
-    ${'sqlite'}                                  | ${'7.4'} | ${'add_extension sqlite3'}
     ${':intl'}                                   | ${'7.4'} | ${'disable_extension intl'}
     ${'ast-beta'}                                | ${'7.4'} | ${'add_unstable_extension ast beta extension'}
-    ${'pdo_mysql'}                               | ${'7.4'} | ${'add_pdo_extension mysql'}
-    ${'pdo-odbc'}                                | ${'7.4'} | ${'add_pdo_extension odbc'}
-    ${'grpc-1.2.3'}                              | ${'7.4'} | ${'add_pecl_extension grpc 1.2.3 extension'}
-    ${'xdebug-alpha'}                            | ${'7.4'} | ${'add_unstable_extension xdebug alpha zend_extension'}
-    ${'pcov'}                                    | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6'}
-    ${'gearman'}                                 | ${'5.6'} | ${'add_gearman'}
-    ${'gearman'}                                 | ${'7.4'} | ${'add_gearman'}
-    ${'couchbase'}                               | ${'5.6'} | ${'add_couchbase'}
+    ${'blackfire'}                               | ${'7.3'} | ${'add_blackfire blackfire'}
+    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
     ${'couchbase'}                               | ${'7.4'} | ${'add_couchbase'}
-    ${'pdo_cubrid'}                              | ${'7.0'} | ${'add_cubrid pdo_cubrid'}
-    ${'pdo_cubrid'}                              | ${'7.4'} | ${'add_pdo_extension cubrid'}
-    ${'xdebug2'}                                 | ${'7.2'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
-    ${'phalcon3'}                                | ${'7.3'} | ${'add_phalcon phalcon3'}
-    ${'ioncube'}                                 | ${'7.3'} | ${'add_ioncube'}
+    ${'gearman'}                                 | ${'5.6'} | ${'add_gearman'}
     ${'geos'}                                    | ${'7.3'} | ${'add_geos'}
-    ${'pecl_http'}                               | ${'7.3'} | ${'add_http'}
+    ${'grpc-1.2.3'}                              | ${'7.4'} | ${'add_pecl_extension grpc 1.2.3 extension'}
     ${'http-1.2.3'}                              | ${'7.3'} | ${'add_http http-1.2.3'}
-    ${'oci8'}                                    | ${'7.3'} | ${'add_oci oci8'}
-    ${'pdo_oci'}                                 | ${'7.3'} | ${'add_oci pdo_oci'}
-    ${'blackfire'}                               | ${'7.3'} | ${'add_blackfire blackfire'}
-    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
     ${'intl-65.1'}                               | ${'5.6'} | ${'add_intl intl-65.1'}
+    ${'ioncube'}                                 | ${'7.3'} | ${'add_ioncube'}
     ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
+    ${'oci8'}                                    | ${'7.3'} | ${'add_oci oci8'}
+    ${'pcov'}                                    | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6'}
+    ${'pdo-odbc'}                                | ${'7.4'} | ${'add_pdo_extension odbc'}
+    ${'pdo_cubrid'}                              | ${'7.0'} | ${'add_cubrid pdo_cubrid'}
+    ${'pdo_cubrid'}                              | ${'7.4'} | ${'add_pdo_extension cubrid'}
+    ${'pdo_mysql'}                               | ${'7.4'} | ${'add_pdo_extension mysql'}
+    ${'pdo_oci'}                                 | ${'7.3'} | ${'add_oci pdo_oci'}
+    ${'pecl_http'}                               | ${'7.3'} | ${'add_http'}
+    ${'phalcon3'}                                | ${'7.3'} | ${'add_phalcon phalcon3'}
+    ${'sqlite'}                                  | ${'7.4'} | ${'add_extension sqlite3'}
+    ${'Xdebug'}                                  | ${'7.4'} | ${'add_extension xdebug'}
+    ${'xdebug-alpha'}                            | ${'7.4'} | ${'add_unstable_extension xdebug alpha zend_extension'}
+    ${'xdebug2'}                                 | ${'7.2'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
   `(
     'checking addExtensionOnLinux for extension $extension on version $version',
     async ({extension, version, output}) => {
@@ -78,31 +73,29 @@ describe('Extension tests', () => {
   it.each`
     extension                                    | version  | output
     ${'none'}                                    | ${'7.2'} | ${'disable_all_shared'}
-    ${'amqp'}                                    | ${'7.2'} | ${'add_brew_extension amqp extension'}
-    ${'Xdebug'}                                  | ${'7.2'} | ${'add_brew_extension xdebug zend_extension'}
-    ${'sqlite'}                                  | ${'7.2'} | ${'add_extension sqlite3'}
     ${':intl'}                                   | ${'7.2'} | ${'disable_extension intl'}
+    ${'amqp'}                                    | ${'7.2'} | ${'add_brew_extension amqp extension'}
     ${'ast-beta'}                                | ${'7.2'} | ${'add_unstable_extension ast beta extension'}
-    ${'grpc-1.2.3'}                              | ${'7.2'} | ${'add_pecl_extension grpc 1.2.3 extension'}
+    ${'blackfire'}                               | ${'7.3'} | ${'add_blackfire blackfire'}
+    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
     ${'couchbase'}                               | ${'5.6'} | ${'add_couchbase'}
-    ${'couchbase'}                               | ${'7.3'} | ${'add_couchbase'}
-    ${'ioncube'}                                 | ${'7.3'} | ${'add_ioncube'}
+    ${'does_not_exist'}                          | ${'7.2'} | ${'add_extension does_not_exist'}
     ${'geos'}                                    | ${'7.3'} | ${'add_geos'}
-    ${'pecl_http'}                               | ${'7.3'} | ${'add_http'}
+    ${'grpc-1.2.3'}                              | ${'7.2'} | ${'add_pecl_extension grpc 1.2.3 extension'}
     ${'http-1.2.3'}                              | ${'7.3'} | ${'add_http http-1.2.3'}
+    ${'imagick'}                                 | ${'5.5'} | ${'add_extension imagick'}
+    ${'ioncube'}                                 | ${'7.3'} | ${'add_ioncube'}
+    ${'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'}
-    ${'pdo_oci'}                                 | ${'7.3'} | ${'add_oci pdo_oci'}
     ${'pcov'}                                    | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
     ${'pcov'}                                    | ${'7.2'} | ${'add_brew_extension pcov'}
-    ${'xdebug'}                                  | ${'5.6'} | ${'add_brew_extension xdebug'}
+    ${'pdo_oci'}                                 | ${'7.3'} | ${'add_oci pdo_oci'}
+    ${'pecl_http'}                               | ${'7.3'} | ${'add_http'}
+    ${'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'}
-    ${'imagick'}                                 | ${'5.5'} | ${'add_extension imagick'}
-    ${'blackfire'}                               | ${'7.3'} | ${'add_blackfire blackfire'}
-    ${'blackfire-1.31.0'}                        | ${'7.3'} | ${'add_blackfire blackfire-1.31.0'}
-    ${'does_not_exist'}                          | ${'7.2'} | ${'add_extension does_not_exist'}
-    ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.2'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
-  `(
+    `(
     'checking addExtensionOnDarwin for extension $extension on version $version',
     async ({extension, version, output}) => {
       expect(