From: William Desportes <williamdes@wdes.fr>
Date: Sun, 13 Apr 2025 12:46:48 +0200
Subject: Skip tests that require not available libraries or PHP extensions

Origin: vendor
Forwarded: not-needed
---
 src/Phing/Listener/MonologListener.php                    |  7 +++++++
 src/Phing/Task/Ext/Hg/HgBaseTask.php                      | 15 +++++++++++++++
 tests/Phing/Test/Io/IniFileParserTest.php                 |  3 +++
 tests/Phing/Test/Listener/MonologListenerTest.php         |  7 +++++++
 tests/Phing/Test/Task/Ext/Analyzer/PHPMDTaskTest.php      |  3 +++
 tests/Phing/Test/Task/Ext/Analyzer/PhpDependTaskTest.php  |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitArchiveTaskTest.php      |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitBaseTest.php             |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitBranchTaskTest.php       |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitCheckoutTaskTest.php     |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitCloneTaskTest.php        |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitDescribeTaskTest.php     |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitFetchTaskTest.php        |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitGcTaskTest.php           |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitInitTaskTest.php         |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitLogTaskTest.php          |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitMergeTaskTest.php        |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitPullTaskTest.php         |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitPushTaskTest.php         |  3 +++
 tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php          |  3 +++
 tests/Phing/Test/Task/Ext/Hg/HgAddTaskTest.php            |  4 ++++
 tests/Phing/Test/Task/Ext/Hg/HgArchiveTaskTest.php        |  4 ++++
 tests/Phing/Test/Task/Ext/Hg/HgCloneTaskTest.php          |  2 ++
 tests/Phing/Test/Task/Ext/Hg/HgCommitTaskTest.php         |  4 ++++
 tests/Phing/Test/Task/Ext/Hg/HgInitTaskTest.php           |  2 ++
 tests/Phing/Test/Task/Ext/Hg/HgLogTaskTest.php            |  4 ++++
 tests/Phing/Test/Task/Ext/Hg/HgPullTaskTest.php           |  2 ++
 tests/Phing/Test/Task/Ext/Hg/HgPushTaskTest.php           |  2 ++
 tests/Phing/Test/Task/Ext/Hg/HgTagTaskTest.php            |  2 ++
 tests/Phing/Test/Task/Ext/Hg/HgTaskTestSkip.php           |  4 ++++
 tests/Phing/Test/Task/Ext/Hg/HgUpdateTaskTest.php         |  2 ++
 tests/Phing/Test/Task/Ext/Http/HttpGetTaskTest.php        |  3 +++
 tests/Phing/Test/Task/Ext/Http/HttpRequestTaskTest.php    |  3 +++
 tests/Phing/Test/Task/Ext/Smarty/SmartyTaskTest.php       |  3 +++
 .../Phing/Test/Task/Ext/Visualizer/VisualizerTaskTest.php |  3 +++
 tests/Phing/Test/Task/Optional/PDODelimitersTest.php      |  4 ++++
 tests/Phing/Test/Task/Optional/PDOTaskTest.php            |  4 ++++
 37 files changed, 132 insertions(+)

diff --git a/src/Phing/Listener/MonologListener.php b/src/Phing/Listener/MonologListener.php
index 5270608..46c26b0 100644
--- a/src/Phing/Listener/MonologListener.php
+++ b/src/Phing/Listener/MonologListener.php
@@ -23,6 +23,7 @@ namespace Phing\Listener;
 use Monolog\Logger;
 use Phing\Project;
 use Phing\Target;
+use Phing\Exception\BuildException;
 
 /**
  * Listener which sends events to Monolog.
@@ -46,6 +47,12 @@ class MonologListener implements BuildListener
      */
     public function __construct()
     {
+        if (!class_exists(Logger::class)) {
+            throw new BuildException(
+                "The Monolog tasks depend on the monolog/monolog package being installed."
+            );
+        }
+
         $this->log = new Logger(self::LOG_PHING);
     }
 
diff --git a/src/Phing/Task/Ext/Hg/HgBaseTask.php b/src/Phing/Task/Ext/Hg/HgBaseTask.php
index a847abf..af9c66e 100644
--- a/src/Phing/Task/Ext/Hg/HgBaseTask.php
+++ b/src/Phing/Task/Ext/Hg/HgBaseTask.php
@@ -59,6 +59,21 @@ abstract class HgBaseTask extends Task
     protected $user = '';
 
     public static $factory = null;
+
+    /**
+     * Initialize Task.
+     * Check and include necessary libraries.
+     */
+    public function init()
+    {
+        if (!class_exists(Factory::class)) {
+            throw new BuildException(
+                "The Hg tasks depend on the siad007/versioncontrol_hg package being installed.",
+                $this->getLocation()
+            );
+        }
+    }
+
     /**
      * Set repository attribute
      *
diff --git a/tests/Phing/Test/Io/IniFileParserTest.php b/tests/Phing/Test/Io/IniFileParserTest.php
index d9e5bb0..9aeec44 100644
--- a/tests/Phing/Test/Io/IniFileParserTest.php
+++ b/tests/Phing/Test/Io/IniFileParserTest.php
@@ -38,6 +38,9 @@ class IniFileParserTest extends TestCase
 
     protected function setUp(): void
     {
+        if (! class_exists(vfsStream::class)) {
+            $this->markTestSkipped('This test depends on the mikey179/vfsstream package being installed.');
+        }
         $this->parser = new IniFileParser();
         $this->root = vfsStream::setUp();
     }
diff --git a/tests/Phing/Test/Listener/MonologListenerTest.php b/tests/Phing/Test/Listener/MonologListenerTest.php
index 1033fd8..754607c 100644
--- a/tests/Phing/Test/Listener/MonologListenerTest.php
+++ b/tests/Phing/Test/Listener/MonologListenerTest.php
@@ -30,6 +30,13 @@ use PHPUnit\Framework\TestCase;
  */
 class MonologListenerTest extends TestCase
 {
+    public function setUp(): void
+    {
+        if (! class_exists('\Monolog\Logger')) {
+            $this->markTestSkipped('The Monolog tasks depend on the monolog/monolog package being installed.');
+        }
+    }
+
     /**
      * @test
      */
diff --git a/tests/Phing/Test/Task/Ext/Analyzer/PHPMDTaskTest.php b/tests/Phing/Test/Task/Ext/Analyzer/PHPMDTaskTest.php
index 3686961..098a418 100644
--- a/tests/Phing/Test/Task/Ext/Analyzer/PHPMDTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Analyzer/PHPMDTaskTest.php
@@ -31,6 +31,9 @@ class PHPMDTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (!class_exists('\PHPMD\PHPMD')) {
+            $this->markTestSkipped('The PHPMD tasks depend on the phpmd/phpmd package being installed.');
+        }
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/phpmd/build.xml');
     }
 
diff --git a/tests/Phing/Test/Task/Ext/Analyzer/PhpDependTaskTest.php b/tests/Phing/Test/Task/Ext/Analyzer/PhpDependTaskTest.php
index 06a37ed..d088b3e 100644
--- a/tests/Phing/Test/Task/Ext/Analyzer/PhpDependTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Analyzer/PhpDependTaskTest.php
@@ -34,6 +34,9 @@ class PhpDependTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (!class_exists('\PDepend\TextUI\Runner')) {
+            $this->markTestSkipped('The PDepend tasks depend on the pdepend/pdepend package being installed.');
+        }
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/pdepend/build.xml');
     }
 
diff --git a/tests/Phing/Test/Task/Ext/Git/GitArchiveTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitArchiveTaskTest.php
index 8ae7b7b..256c402 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitArchiveTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitArchiveTaskTest.php
@@ -33,6 +33,9 @@ class GitArchiveTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         // set temp directory used by test cases
         mkdir(PHING_TEST_BASE . '/tmp/git');
 
diff --git a/tests/Phing/Test/Task/Ext/Git/GitBaseTest.php b/tests/Phing/Test/Task/Ext/Git/GitBaseTest.php
index 57614c2..90dcb4e 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitBaseTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitBaseTest.php
@@ -35,6 +35,9 @@ class GitBaseTest extends BuildFileTest
 
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         $this->configureProject(
             PHING_TEST_BASE
             . '/etc/tasks/ext/git/GitBaseTest.xml'
diff --git a/tests/Phing/Test/Task/Ext/Git/GitBranchTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitBranchTaskTest.php
index 259e47e..d023ced 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitBranchTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitBranchTaskTest.php
@@ -32,6 +32,9 @@ class GitBranchTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitCheckoutTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitCheckoutTaskTest.php
index 29061f8..08e996b 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitCheckoutTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitCheckoutTaskTest.php
@@ -32,6 +32,9 @@ class GitCheckoutTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitCloneTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitCloneTaskTest.php
index 0dad366..879b4c8 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitCloneTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitCloneTaskTest.php
@@ -32,6 +32,9 @@ class GitCloneTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         // set temp directory used by test cases
         mkdir(PHING_TEST_BASE . '/tmp/git');
 
diff --git a/tests/Phing/Test/Task/Ext/Git/GitDescribeTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitDescribeTaskTest.php
index 7039a9c..b9f9d2d 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitDescribeTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitDescribeTaskTest.php
@@ -31,6 +31,9 @@ class GitDescribeTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitFetchTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitFetchTaskTest.php
index e81235c..a2f9725 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitFetchTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitFetchTaskTest.php
@@ -31,6 +31,9 @@ class GitFetchTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitGcTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitGcTaskTest.php
index 6b58a38..07ca6c3 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitGcTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitGcTaskTest.php
@@ -32,6 +32,9 @@ class GitGcTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitInitTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitInitTaskTest.php
index a89e390..7727734 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitInitTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitInitTaskTest.php
@@ -32,6 +32,9 @@ class GitInitTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         // set temp directory used by test cases
         mkdir(PHING_TEST_BASE . '/tmp/git');
 
diff --git a/tests/Phing/Test/Task/Ext/Git/GitLogTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitLogTaskTest.php
index 83f40b5..888ddae 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitLogTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitLogTaskTest.php
@@ -101,6 +101,9 @@ class GitLogTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitMergeTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitMergeTaskTest.php
index a11e59f..ac2d11c 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitMergeTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitMergeTaskTest.php
@@ -32,6 +32,9 @@ class GitMergeTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitPullTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitPullTaskTest.php
index d4e46f7..311f519 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitPullTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitPullTaskTest.php
@@ -32,6 +32,9 @@ class GitPullTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitPushTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitPushTaskTest.php
index bed7fe5..63ddb75 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitPushTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitPushTaskTest.php
@@ -32,6 +32,9 @@ class GitPushTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php b/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php
index c65d19b..2bb9742 100644
--- a/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Git/GitTagTaskTest.php
@@ -32,6 +32,9 @@ class GitTagTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! class_exists('VersionControl_Git')) {
+            $this->markTestSkipped('The Git tasks depend on the pear/versioncontrol_git package being installed.');
+        }
         if (is_readable(PHING_TEST_BASE . '/tmp/git')) {
             // make sure we purge previously created directory
             // if left-overs from previous run are found
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgAddTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgAddTaskTest.php
index b7d64a1..706b53d 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgAddTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgAddTaskTest.php
@@ -25,8 +25,12 @@ use Phing\Test\Support\BuildFileTest;
  */
 class HgAddTaskTest extends BuildFileTest
 {
+    use HgTaskTestSkip;
+
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgArchiveTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgArchiveTaskTest.php
index 02c2785..a462382 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgArchiveTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgArchiveTaskTest.php
@@ -25,8 +25,12 @@ use Phing\Test\Support\BuildFileTest;
  */
 class HgArchiveTaskTest extends BuildFileTest
 {
+    use HgTaskTestSkip;
+
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgCloneTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgCloneTaskTest.php
index 3e41811..eaf2291 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgCloneTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgCloneTaskTest.php
@@ -29,6 +29,8 @@ class HgCloneTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         $this->configureProject(
             PHING_TEST_BASE
             . '/etc/tasks/ext/hg/HgCloneTaskTest.xml'
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgCommitTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgCommitTaskTest.php
index 7a3f076..cd7a02b 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgCommitTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgCommitTaskTest.php
@@ -25,8 +25,12 @@ use Phing\Test\Support\BuildFileTest;
  */
 class HgCommitTaskTest extends BuildFileTest
 {
+    use HgTaskTestSkip;
+
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgInitTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgInitTaskTest.php
index 5d13c50..a6e56c7 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgInitTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgInitTaskTest.php
@@ -29,6 +29,8 @@ class HgInitTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgLogTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgLogTaskTest.php
index 35e6353..d4c14aa 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgLogTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgLogTaskTest.php
@@ -25,8 +25,12 @@ use Phing\Test\Support\BuildFileTest;
  */
 class HgLogTaskTest extends BuildFileTest
 {
+    use HgTaskTestSkip;
+
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgPullTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgPullTaskTest.php
index 179697f..0f7b8ff 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgPullTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgPullTaskTest.php
@@ -29,6 +29,8 @@ class HgPullTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgPushTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgPushTaskTest.php
index d6dc56c..3979b22 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgPushTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgPushTaskTest.php
@@ -29,6 +29,8 @@ class HgPushTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgTagTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgTagTaskTest.php
index ac9f93a..83f3e4b 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgTagTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgTagTaskTest.php
@@ -29,6 +29,8 @@ class HgTagTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgTaskTestSkip.php b/tests/Phing/Test/Task/Ext/Hg/HgTaskTestSkip.php
index cae7164..f85cda8 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgTaskTestSkip.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgTaskTestSkip.php
@@ -26,6 +26,10 @@ trait HgTaskTestSkip
 {
     public function markTestAsSkippedWhenHgNotInstalled(): void
     {
+        if (! class_exists('\Siad007\VersionControl\HG\Factory')) {
+            $this->markTestSkipped('The Git tasks depend on the siad007/versioncontrol_hg package being installed.');
+        }
+
         exec('hg help > /dev/null 2>&1', $output, $code);
         if (0 != $code) {
             $this->markTestSkipped('This test require hg to be installed');
diff --git a/tests/Phing/Test/Task/Ext/Hg/HgUpdateTaskTest.php b/tests/Phing/Test/Task/Ext/Hg/HgUpdateTaskTest.php
index 7e567d2..2dceefd 100644
--- a/tests/Phing/Test/Task/Ext/Hg/HgUpdateTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Hg/HgUpdateTaskTest.php
@@ -29,6 +29,8 @@ class HgUpdateTaskTest extends BuildFileTest
 
     public function setUp(): void
     {
+        $this->markTestAsSkippedWhenHgNotInstalled();
+
         mkdir(PHING_TEST_BASE . '/tmp/hgtest');
         $this->configureProject(
             PHING_TEST_BASE
diff --git a/tests/Phing/Test/Task/Ext/Http/HttpGetTaskTest.php b/tests/Phing/Test/Task/Ext/Http/HttpGetTaskTest.php
index 1fb1e85..a815269 100644
--- a/tests/Phing/Test/Task/Ext/Http/HttpGetTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Http/HttpGetTaskTest.php
@@ -33,6 +33,9 @@ class HttpGetTaskTest extends BaseHttpTaskTest
 {
     public function setUp(): void
     {
+        if (!class_exists('\GuzzleHttp\Client')) {
+            $this->markTestSkipped('The Http tasks depend on the guzzlehttp/guzzle package being installed.');
+        }
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/http/httpget.xml');
     }
 
diff --git a/tests/Phing/Test/Task/Ext/Http/HttpRequestTaskTest.php b/tests/Phing/Test/Task/Ext/Http/HttpRequestTaskTest.php
index b839ba9..c82efe2 100644
--- a/tests/Phing/Test/Task/Ext/Http/HttpRequestTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Http/HttpRequestTaskTest.php
@@ -32,6 +32,9 @@ class HttpRequestTaskTest extends BaseHttpTaskTest
 {
     public function setUp(): void
     {
+        if (!class_exists('\GuzzleHttp\Client')) {
+            $this->markTestSkipped('The Http tasks depend on the guzzlehttp/guzzle package being installed.');
+        }
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/http/httprequest.xml');
     }
 
diff --git a/tests/Phing/Test/Task/Ext/Smarty/SmartyTaskTest.php b/tests/Phing/Test/Task/Ext/Smarty/SmartyTaskTest.php
index be6f321..d1df590 100644
--- a/tests/Phing/Test/Task/Ext/Smarty/SmartyTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Smarty/SmartyTaskTest.php
@@ -26,6 +26,9 @@ class SmartyTaskTest extends BuildFileTest
 {
     protected function setUp(): void
     {
+        if (!class_exists('\Smarty\Smarty')) {
+            $this->markTestSkipped('The Smarty tasks depend on the smarty/smarty package being installed.');
+        }
         $buildXmlFile = PHING_TEST_BASE . '/etc/tasks/ext/smarty/SmartyTaskTest.xml';
         $this->configureProject($buildXmlFile);
         $this->executeTarget('setup');
diff --git a/tests/Phing/Test/Task/Ext/Visualizer/VisualizerTaskTest.php b/tests/Phing/Test/Task/Ext/Visualizer/VisualizerTaskTest.php
index 8900604..f716197 100644
--- a/tests/Phing/Test/Task/Ext/Visualizer/VisualizerTaskTest.php
+++ b/tests/Phing/Test/Task/Ext/Visualizer/VisualizerTaskTest.php
@@ -32,6 +32,9 @@ class VisualizerTaskTest extends BuildFileTest
      */
     public function setUp(): void
     {
+        if (!class_exists('\GuzzleHttp\Client')) {
+            $this->markTestSkipped('The Visualizer tasks depend on the guzzlehttp/guzzle package being installed.');
+        }
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/visualizer/VisualizerTaskTest.xml');
     }
 
diff --git a/tests/Phing/Test/Task/Optional/PDODelimitersTest.php b/tests/Phing/Test/Task/Optional/PDODelimitersTest.php
index 7d7d576..54afdab 100644
--- a/tests/Phing/Test/Task/Optional/PDODelimitersTest.php
+++ b/tests/Phing/Test/Task/Optional/PDODelimitersTest.php
@@ -41,6 +41,10 @@ class PDODelimitersTest extends BuildFileTest
      */
     public function setUp(): void
     {
+        if (! extension_loaded('pdo_sqlite')) {
+            $this->markTestSkipped('The PHP pdo sqlite (pdo_sqlite) is needed for this test.');
+        }
+
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/pdo/empty.xml');
         $this->queries = [];
 
diff --git a/tests/Phing/Test/Task/Optional/PDOTaskTest.php b/tests/Phing/Test/Task/Optional/PDOTaskTest.php
index d5fa2fc..0c93695 100644
--- a/tests/Phing/Test/Task/Optional/PDOTaskTest.php
+++ b/tests/Phing/Test/Task/Optional/PDOTaskTest.php
@@ -26,6 +26,10 @@ class PDOTaskTest extends BuildFileTest
 {
     public function setUp(): void
     {
+        if (! extension_loaded('pdo_sqlite')) {
+            $this->markTestSkipped('The PHP pdo sqlite (pdo_sqlite) is needed for this test.');
+        }
+
         $this->configureProject(PHING_TEST_BASE . '/etc/tasks/ext/pdo/test.xml');
     }
 
