From e1f04b98d6ef2e2fec136c0a0053ca7b47cec279 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 28 Feb 2025 20:52:44 +0400 Subject: [PATCH] importation initiale --- .gitattributes | 1 + .gitignore | 12 ++++ .idea/inspectionProfiles/Project_Default.xml | 14 ++++ .idea/modules.xml | 8 +++ .idea/nulib-tests.iml | 12 ++++ .idea/php-docker-settings.xml | 24 +++++++ .idea/php.xml | 58 +++++++++++++++ .idea/vcs.xml | 6 ++ .pman.conf | 11 +++ .runphp.conf | 8 +++ composer.json | 29 ++++++++ composer.lock | 18 +++++ run-tests | 4 ++ src/TestCase.php | 76 ++++++++++++++++++++ tests/.keep | 0 15 files changed, 281 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/nulib-tests.iml create mode 100644 .idea/php-docker-settings.xml create mode 100644 .idea/php.xml create mode 100644 .idea/vcs.xml create mode 100644 .pman.conf create mode 100644 .runphp.conf create mode 100644 composer.json create mode 100644 composer.lock create mode 100755 run-tests create mode 100644 src/TestCase.php create mode 100644 tests/.keep diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ef72495 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/sbin/composer.phar -delta diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62033b5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/.composer.lock.runphp + +.~lock*# +.*.swp +/vendor/ + +/.idea/shelf/ +/.idea/workspace.xml +/.idea/httpRequests/ +/.idea/dataSources/ +/.idea/dataSources.local.xml +/.phpunit.result.cache diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..f0e209f --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5065ad7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/nulib-tests.iml b/.idea/nulib-tests.iml new file mode 100644 index 0000000..bd801f5 --- /dev/null +++ b/.idea/nulib-tests.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/php-docker-settings.xml b/.idea/php-docker-settings.xml new file mode 100644 index 0000000..d9d8edc --- /dev/null +++ b/.idea/php-docker-settings.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..b650582 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.pman.conf b/.pman.conf new file mode 100644 index 0000000..ff9cd5a --- /dev/null +++ b/.pman.conf @@ -0,0 +1,11 @@ +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 + +UPSTREAM= +DEVELOP=dev +FEATURE=wip/ +RELEASE= +MAIN= +TAG_SUFFIX= +HOTFIX= +DIST= +NOAUTO= diff --git a/.runphp.conf b/.runphp.conf new file mode 100644 index 0000000..75c5696 --- /dev/null +++ b/.runphp.conf @@ -0,0 +1,8 @@ +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 + +# Chemin vers runphp, e.g sbin/runphp +RUNPHP= + +# Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies +DIST=d11 +#REGISTRY=pubdocker.univ-reunion.fr/dist diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5fc1777 --- /dev/null +++ b/composer.json @@ -0,0 +1,29 @@ +{ + "name": "nulib/tests", + "description": "fonctions et classes pour les tests", + "type": "library", + "repositories": [ + { + "type": "composer", + "url": "https://repos.univ-reunion.fr/composer" + } + ], + "require": { + }, + "autoload": { + "psr-4": { + "nulib\\tests\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "nulib\\tests\\": "tests" + } + }, + "authors": [ + { + "name": "Jephte Clain", + "email": "Jephte.Clain@univ-reunion.fr" + } + ] +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..4431f22 --- /dev/null +++ b/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "4bf96ddf8e061d71f11bf0a8906a344b", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.2.0" +} diff --git a/run-tests b/run-tests new file mode 100755 index 0000000..c87c55e --- /dev/null +++ b/run-tests @@ -0,0 +1,4 @@ +#!/bin/bash +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 +MYDIR="$(dirname -- "$0")" +"$MYDIR/vendor/bin/phpunit" --bootstrap "$MYDIR/vendor/autoload.php" "$@" "$MYDIR/tests" diff --git a/src/TestCase.php b/src/TestCase.php new file mode 100644 index 0000000..f91bee5 --- /dev/null +++ b/src/TestCase.php @@ -0,0 +1,76 @@ +origTz = date_default_timezone_get(); + date_default_timezone_set("Indian/Reunion"); + } + + protected function tearDown(): void { + if ($this->origTz !== '') { + date_default_timezone_set($this->origTz); + } + } +} diff --git a/tests/.keep b/tests/.keep new file mode 100644 index 0000000..e69de29