From 5f4ab52677df291834dcdf1d367f47ae6b8745cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= Date: Wed, 6 Sep 2023 17:10:21 +0200 Subject: [PATCH 1/6] Update tests to run with recent phpunit versions --- tests/CheckPasswordTest.php | 2 +- tests/CheckSshkeyTest.php | 2 +- tests/CryptoTest.php | 2 +- tests/HookTest.php | 2 +- tests/LangTest.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/CheckPasswordTest.php b/tests/CheckPasswordTest.php index 5af210af..2458e243 100644 --- a/tests/CheckPasswordTest.php +++ b/tests/CheckPasswordTest.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../lib/vendor/defuse-crypto.phar'; -class CheckPasswordTest extends \PHPUnit_Framework_TestCase +class CheckPasswordTest extends \PHPUnit\Framework\TestCase { /** * Test check_password_strength function diff --git a/tests/CheckSshkeyTest.php b/tests/CheckSshkeyTest.php index 796e4771..62022644 100644 --- a/tests/CheckSshkeyTest.php +++ b/tests/CheckSshkeyTest.php @@ -1,6 +1,6 @@ Date: Wed, 6 Sep 2023 17:13:41 +0200 Subject: [PATCH 2/6] Fix lang files to run tests without errors --- lang/ca.inc.php | 5 ++--- lang/it.inc.php | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/ca.inc.php b/lang/ca.inc.php index 604924c7..7e425d76 100644 --- a/lang/ca.inc.php +++ b/lang/ca.inc.php @@ -1,5 +1,4 @@ - -
<?php
+
\ No newline at end of file
+$messages['invalidsshkey'] = "Input SSH Key looks invalid";
diff --git a/lang/it.inc.php b/lang/it.inc.php
index c5afc0e3..790a6fa1 100644
--- a/lang/it.inc.php
+++ b/lang/it.inc.php
@@ -152,3 +152,4 @@
 $messages['badquality'] = "La qualità della password è troppo bassa";
 $messages['tooyoung'] = "La password è stata cambiata troppo di recente";
 $messages['inhistory'] = "La password è nello storico delle precedenti";
+$messages['invalidsshkey'] = "Input SSH Key looks invalid";

From 8a5db803edb74ce44da6071d4e1bc91f99022e9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= 
Date: Wed, 6 Sep 2023 17:18:19 +0200
Subject: [PATCH 3/6] Define CI to run phpunit tests

---
 .github/workflows/ci.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 .github/workflows/ci.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..ea9ddfdc
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,12 @@
+name: CI
+
+on: [push]
+
+jobs:
+  build-test:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v3
+    - uses: php-actions/composer@v6
+    - uses: php-actions/phpunit@v3

From d70709f2cd90291901105ff61d504b7ecd81e593 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= 
Date: Wed, 6 Sep 2023 17:21:46 +0200
Subject: [PATCH 4/6] Do not run composer yet

---
 .github/workflows/ci.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ea9ddfdc..30b844ec 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -8,5 +8,4 @@ jobs:
 
     steps:
     - uses: actions/checkout@v3
-    - uses: php-actions/composer@v6
     - uses: php-actions/phpunit@v3

From e73575f1a6e5d292586c3503507f163229499ced Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= 
Date: Fri, 15 Sep 2023 14:50:43 +0200
Subject: [PATCH 5/6] Use phpunit.xml

---
 .github/workflows/ci.yml | 8 +++++++-
 tests/phpunit.xml        | 9 +++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 tests/phpunit.xml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 30b844ec..f205e73c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -8,4 +8,10 @@ jobs:
 
     steps:
     - uses: actions/checkout@v3
-    - uses: php-actions/phpunit@v3
+    - name: PHPUnit Tests for php7.4
+        uses: php-actions/phpunit@v3
+        with:
+          configuration: tests/phpunit.xml
+          version: 5.7.25
+          php_version: 7.4
+          args: --coverage-text
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
new file mode 100644
index 00000000..f18476f5
--- /dev/null
+++ b/tests/phpunit.xml
@@ -0,0 +1,9 @@
+
+
+	
+		
+			.
+		
+	
+	
+

From ca530ec4fdc34720f437617dc2471dc1a1aadb11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= 
Date: Fri, 15 Sep 2023 14:56:25 +0200
Subject: [PATCH 6/6] Space opera

---
 .github/workflows/ci.yml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f205e73c..e89ce0ed 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,9 +9,9 @@ jobs:
     steps:
     - uses: actions/checkout@v3
     - name: PHPUnit Tests for php7.4
-        uses: php-actions/phpunit@v3
-        with:
-          configuration: tests/phpunit.xml
-          version: 5.7.25
-          php_version: 7.4
-          args: --coverage-text
+      uses: php-actions/phpunit@v3
+      with:
+        configuration: tests/phpunit.xml
+        version: 5.7.25
+        php_version: 7.4
+        args: --coverage-text