From 5b245a3f8549165006218431c72b9b39c8b5a3b5 Mon Sep 17 00:00:00 2001 From: rugk Date: Fri, 18 Oct 2024 02:18:45 +0200 Subject: [PATCH 1/2] Fix phpunit doc missing crucial step of installing GCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I tried following the steps when running, for https://github.com/PrivateBin/PrivateBin/pull/1421, but this crucial one step is missing. Maybe more was missing, most tests failed so hmm… but I only wanted it for the SRI generation and this was hard enough. (And no, I did not feel like trying to run a container in a [dev]container, so these manual steps should better work.) Maybe we can improve that further here, I the things I've noticed in this or the other PR. --- doc/Running Unit Tests.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/Running Unit Tests.md b/doc/Running Unit Tests.md index 95078258..2eef1a1d 100644 --- a/doc/Running Unit Tests.md +++ b/doc/Running Unit Tests.md @@ -43,6 +43,11 @@ Example for Debian and Ubuntu: $ sudo apt install phpunit php-gd php-sqlite3 php-xdebug ``` +Because the unit tests depend on this, you also need to install the optional. Otherwise they won't run: +```console +composer require google/cloud-storage +``` + To run the tests, change into the `tst` directory and run phpunit: ```console From 763d6fca7e2c2f2ae8fa70679273abc3d148657f Mon Sep 17 00:00:00 2001 From: rugk Date: Fri, 18 Oct 2024 02:20:50 +0200 Subject: [PATCH 2/2] Adding hint that you will see unrelated files and to ignore these --- doc/Running Unit Tests.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Running Unit Tests.md b/doc/Running Unit Tests.md index 2eef1a1d..1a5770bc 100644 --- a/doc/Running Unit Tests.md +++ b/doc/Running Unit Tests.md @@ -48,6 +48,9 @@ Because the unit tests depend on this, you also need to install the optional. Ot composer require google/cloud-storage ``` +If you do this and want to develop further, please go into `.gitignore` and adjust it to ignore the whole +vendor directory. Otherwise your `git status` will be filled with lot's of unrelated PHP files. + To run the tests, change into the `tst` directory and run phpunit: ```console