From 3f95d8278fc20cdc53936ee8eac2361a12440312 Mon Sep 17 00:00:00 2001
From: Fibinger Ádám <adam.fibinger@wup.hu>
Date: Fri, 22 Oct 2021 23:45:54 +0200
Subject: [PATCH] Documentation, Composer and test configuration fixes

---
 phpunit.xml   |    1 +
 bin/phpunit   |   19 +++++++++++++++++++
 composer.json |    4 ++--
 README.md     |   26 +++++++++++++++++++++++---
 4 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index f269d63..4d792bb 100644
--- a/README.md
+++ b/README.md
@@ -25,9 +25,10 @@
 ```
 git clone https://shr:yRmglFOqNMbwpnuhP5iy@git.unr.hu/r/shoprenter-secretserver.git secretserver.website.tld
 cd secretserver.website.tld
+composer install --no-dev
 ```
 
-This is gonna create an Sqlite DB (or anything else if you changed the config) with the correct schema (you can check the .env file about the details) in the project dir (`var/data.db`):
+This is will create an Sqlite DB (or anything else if you changed the config) with the correct schema (you can check the .env file about the details) in the project dir (`var/data.db`):
 
 ```
 php bin/console doctrine:database:create
@@ -55,7 +56,26 @@
 
 #### Locally
 Fire up this baby:
-`symfony server:start`
+```
+symfony server:start
+```
 
 ### Deploy
-Only god knows what you are using (Apache, Nginx, Windows Server), you can configure as a normal symfony project: https://symfony.com/doc/current/setup/web_server_configuration.html
+Only God knows what you are using (Apache, Nginx, Windows Server), you can configure as a normal symfony project: https://symfony.com/doc/current/setup/web_server_configuration.html
+
+## Testing
+
+### Installing dev libraries
+If you followed point-by-point your version of the project does not contains dev libraries, you have to install it: 
+```
+composer install
+```
+And get the tests running:
+```
+php bin/phpunit
+```
+Probably you will get some errors, most likely the recent removal of monolog from default Symfony install.
+My only option would be to mask up, but I prefer not to: https://github.com/liip/LiipTestFixturesBundle/issues/135
+
+### Questions
+Are welcome @ (vfiber@gmail.com)[mailto:vfiber@gmail.com] / (adam.fibinger@gmail.com)[mailto:adam.fibinger@gmail.com]
diff --git a/bin/phpunit b/bin/phpunit
new file mode 100644
index 0000000..f26f2c7
--- /dev/null
+++ b/bin/phpunit
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+<?php
+
+if (!ini_get('date.timezone')) {
+    ini_set('date.timezone', 'UTC');
+}
+
+if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
+    define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
+    require PHPUNIT_COMPOSER_INSTALL;
+    PHPUnit\TextUI\Command::main();
+} else {
+    if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
+        echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
+        exit(1);
+    }
+
+    require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
+}
diff --git a/composer.json b/composer.json
index 7641343..bc1d64b 100644
--- a/composer.json
+++ b/composer.json
@@ -31,13 +31,13 @@
         "symfony/serializer": "5.3.*",
         "symfony/twig-bundle": "5.3.*",
         "symfony/validator": "5.3.*",
-        "symfony/yaml": "5.3.*"
+        "symfony/yaml": "5.3.*",
+        "symfony/maker-bundle": "^1.34"
     },
     "require-dev": {
         "justinrainbow/json-schema": "^5.2",
         "phpunit/phpunit": "^9.5",
         "symfony/css-selector": "5.3.*",
-        "symfony/maker-bundle": "^1.34",
         "symfony/phpunit-bridge": "^5.3"
     },
     "config": {
diff --git a/phpunit.xml b/phpunit.xml
index 270c105..ff38ac6 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -13,6 +13,7 @@
         <server name="SHELL_VERBOSITY" value="-1" />
         <server name="SYMFONY_PHPUNIT_REMOVE" value="" />
         <server name="SYMFONY_PHPUNIT_VERSION" value="9.5" />
+        <server name="KERNEL_CLASS" value="App\Kernel" />
     </php>
 
     <testsuites>

--
Gitblit v1.8.0