From 9f901575860f0862594524e23218635aa3ff7b33 Mon Sep 17 00:00:00 2001
From: Gwendolen Lynch <gwendolen.lynch@gmail.com>
Date: Wed, 3 Aug 2022 16:39:30 +0200
Subject: [PATCH] Update test tooling

---
 .gitignore                     |  1 +
 composer.json                  |  3 ++-
 phpunit.xml.dist               | 30 ++++++++++++++++++++++++++++++
 tests/Unit/OccurrencesTest.php |  5 ++++-
 tests/Unit/SpeciesTest.php     |  4 ++++
 5 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 phpunit.xml.dist

diff --git a/.gitignore b/.gitignore
index 7a68906..27d8c35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 /vendor
 /composer.lock
+/phpunit.xml
 /public
 /docs
 
diff --git a/composer.json b/composer.json
index 3501dcf..99c6c7c 100644
--- a/composer.json
+++ b/composer.json
@@ -19,12 +19,13 @@
         }
     ],
     "minimum-stability": "dev",
+    "prefer-stable": true,
     "require": {
         "php": ">=7.2",
         "guzzlehttp/guzzle": "^6.0|^7.0"
     },
     "require-dev": {
-        "phpunit/phpunit": "8.5.x-dev"
+        "phpunit/phpunit": "^9.3"
     },
     "support": {
         "source": "https://gitlab.res-telae.cat/restelae/php-gbif"
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 0000000..4237d86
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
+         bootstrap="vendor/autoload.php"
+         executionOrder="depends,defects"
+         forceCoversAnnotation="true"
+         beStrictAboutCoversAnnotation="false"
+         beStrictAboutOutputDuringTests="true"
+         beStrictAboutTodoAnnotatedTests="true"
+         convertDeprecationsToExceptions="true"
+         colors="true"
+         verbose="true"
+>
+    <php>
+        <ini name="display_errors" value="1" />
+        <ini name="error_reporting" value="-1" />
+    </php>
+
+    <testsuites>
+        <testsuite name="PHP-GBIF Test Suite">
+            <directory>tests/Unit</directory>
+        </testsuite>
+    </testsuites>
+
+    <coverage processUncoveredFiles="true">
+        <include>
+            <directory suffix=".php">src</directory>
+        </include>
+    </coverage>
+</phpunit>
diff --git a/tests/Unit/OccurrencesTest.php b/tests/Unit/OccurrencesTest.php
index 7b85ba5..18c0b8c 100644
--- a/tests/Unit/OccurrencesTest.php
+++ b/tests/Unit/OccurrencesTest.php
@@ -4,8 +4,11 @@ namespace ResTelae\Gbif\Tests\Unit;
 
 use PHPUnit\Framework\TestCase;
 use ResTelae\Gbif\Occurrences;
-use ResTelae\Gbif\Species;
 
+/**
+ * @covers \ResTelae\Gbif\Occurrences
+ * @internal
+ */
 final class OccurrencesTest extends TestCase
 {
     /** @var Occurrences */
diff --git a/tests/Unit/SpeciesTest.php b/tests/Unit/SpeciesTest.php
index 6769576..70b13b0 100644
--- a/tests/Unit/SpeciesTest.php
+++ b/tests/Unit/SpeciesTest.php
@@ -5,6 +5,10 @@ namespace ResTelae\Gbif\Tests\Unit;
 use PHPUnit\Framework\TestCase;
 use ResTelae\Gbif\Species;
 
+/**
+ * @covers \ResTelae\Gbif\Species
+ * @internal
+ */
 final class SpeciesTest extends TestCase
 {
     /** @var Species */
-- 
GitLab