[opendebitdeboisson-commits] r400 - in branches/poc-upgrade-om-4.10: . obj tests

0 views
Skip to first unread message

fmi...@hephaestos.ovh.adullact.org

unread,
Apr 15, 2020, 8:48:49 AM4/15/20
to openmairie-ope...@googlegroups.com
Author: fmichon
Date: 2020-04-15 14:48:47 +0200 (Wed, 15 Apr 2020)
New Revision: 400

Added:
branches/poc-upgrade-om-4.10/tests/config-php70.xml
branches/poc-upgrade-om-4.10/tests/testGeneral_common.php
branches/poc-upgrade-om-4.10/tests/testGeneral_php70.php
Removed:
branches/poc-upgrade-om-4.10/tests/bootstrap.php
Modified:
branches/poc-upgrade-om-4.10/
branches/poc-upgrade-om-4.10/EXTERNALS.txt
branches/poc-upgrade-om-4.10/HISTORY.txt
branches/poc-upgrade-om-4.10/obj/opendebitdeboisson.class.php
branches/poc-upgrade-om-4.10/tests/config.xml
branches/poc-upgrade-om-4.10/tests/pip-requirements.txt
branches/poc-upgrade-om-4.10/tests/testGeneral.php
Log:
* Rebase.


Index: branches/poc-upgrade-om-4.10
===================================================================
--- branches/poc-upgrade-om-4.10 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10 2020-04-15 12:48:47 UTC (rev 400)

Property changes on: branches/poc-upgrade-om-4.10
___________________________________________________________________
Modified: svn:externals
## -6,3 +6,4 ##
core https://scm.adullact.net/anonscm/svn/openmairie/openmairie_exemple/branches/4.10.0-develop/core
lib https://scm.adullact.net/anonscm/svn/openmairie/openmairie_exemple/branches/4.10.0-develop/lib
php https://scm.adullact.net/anonscm/svn/openmairie/openmairie_exemple/branches/4.10.0-develop/php
+
Modified: svn:mergeinfo
## -7,4 +7,4 ##
/branches/2.0.0-traitement-demande:251-260
/branches/2.0.0-vue-synthetique:285-314
/branches/2.1.0-develop:369-376
-/trunk:383-386
\ No newline at end of property
+/trunk:383-399
\ No newline at end of property
Modified: branches/poc-upgrade-om-4.10/EXTERNALS.txt
===================================================================
--- branches/poc-upgrade-om-4.10/EXTERNALS.txt 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/EXTERNALS.txt 2020-04-15 12:48:47 UTC (rev 400)
@@ -6,3 +6,4 @@
core https://scm.adullact.net/anonscm/svn/openmairie/openmairie_exemple/branches/4.10.0-develop/core
lib https://scm.adullact.net/anonscm/svn/openmairie/openmairie_exemple/branches/4.10.0-develop/lib
php https://scm.adullact.net/anonscm/svn/openmairie/openmairie_exemple/branches/4.10.0-develop/php
+

Modified: branches/poc-upgrade-om-4.10/HISTORY.txt
===================================================================
--- branches/poc-upgrade-om-4.10/HISTORY.txt 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/HISTORY.txt 2020-04-15 12:48:47 UTC (rev 400)
@@ -4,9 +4,13 @@
2.1.1 (unreleased)
------------------

-* Aucun changement.
+* Évolution : Mise à jour du framework openMairie > v4.9.6.
+ Ticket #????.

+* Tests : Réorganisation des tests phpunit pour support à la fois PHP7.0 & PHP7.1+.
+* Correction : PHP Fatal error: Declaration of General::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /home/jenkins/tmp/workspace/openDebitDeBoisson/tests/testGeneral.php on line 51. Compatibilité PHP7.2.

+
2.1.0 (22/07/2019)
------------------


Modified: branches/poc-upgrade-om-4.10/obj/opendebitdeboisson.class.php
===================================================================
--- branches/poc-upgrade-om-4.10/obj/opendebitdeboisson.class.php 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/obj/opendebitdeboisson.class.php 2020-04-15 12:48:47 UTC (rev 400)
@@ -19,6 +19,12 @@
define("PATH_OPENMAIRIE", getcwd()."/../core/");

/**
+ * TCPDF specific config
+ */
+define("K_TCPDF_EXTERNAL_CONFIG", true);
+define("K_TCPDF_CALLS_IN_HTML", true);
+
+/**
* Dépendances PHP du framework
* On modifie la valeur de la directive de configuration include_path en
* fonction pour y ajouter les chemins vers les librairies dont le framework

Deleted: branches/poc-upgrade-om-4.10/tests/bootstrap.php
===================================================================
--- branches/poc-upgrade-om-4.10/tests/bootstrap.php 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/tests/bootstrap.php 2020-04-15 12:48:47 UTC (rev 400)
@@ -1,2 +0,0 @@
-<?php
-session_start();

Copied: branches/poc-upgrade-om-4.10/tests/config-php70.xml (from rev 399, trunk/tests/config-php70.xml)
===================================================================
--- branches/poc-upgrade-om-4.10/tests/config-php70.xml (rev 0)
+++ branches/poc-upgrade-om-4.10/tests/config-php70.xml 2020-04-15 12:48:47 UTC (rev 400)
@@ -0,0 +1,7 @@
+<phpunit>
+ <testsuites>
+ <testsuite name="opendebitdeboisson">
+ <file>testGeneral_php70.php</file>
+ </testsuite>
+ </testsuites>
+</phpunit>

Modified: branches/poc-upgrade-om-4.10/tests/config.xml
===================================================================
--- branches/poc-upgrade-om-4.10/tests/config.xml 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/tests/config.xml 2020-04-15 12:48:47 UTC (rev 400)
@@ -1,4 +1,4 @@
-<phpunit>
+<phpunit stderr="true">
<testsuites>
<testsuite name="opendebitdeboisson">
<file>testGeneral.php</file>

Modified: branches/poc-upgrade-om-4.10/tests/pip-requirements.txt
===================================================================
--- branches/poc-upgrade-om-4.10/tests/pip-requirements.txt 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/tests/pip-requirements.txt 2020-04-15 12:48:47 UTC (rev 400)
@@ -1,5 +1,5 @@
openmairie.devtools==0.4.0
-openmairie.robotframework==4.8.10006
+openmairie.robotframework==4.9.10008
maildump==0.5.6
selenium==2.53.6
robotframework==3.0.4

Modified: branches/poc-upgrade-om-4.10/tests/testGeneral.php
===================================================================
--- branches/poc-upgrade-om-4.10/tests/testGeneral.php 2020-04-09 16:55:47 UTC (rev 399)
+++ branches/poc-upgrade-om-4.10/tests/testGeneral.php 2020-04-15 12:48:47 UTC (rev 400)
@@ -1,51 +1,20 @@
<?php
/**
- * Tests unitaires PHPUnit.
+ * Ce script contient la définition de la classe 'GeneralTest'.
*
* @package opendebitdeboisson
- * @version SVN : $Id$
+ * @version SVN : $Id: testGeneral.php 1058 2020-03-25 15:31:10Z fmichon $
*/

-/**
- * Cette classe permet de tester unitairement les fonctions de l'application.
- */
-class General extends PHPUnit\Framework\TestCase {
-
- /**
- * Méthode lancée en début de traitement
- */
- public function setUp() {
-
- // Instancie la timezone
- date_default_timezone_set('Europe/Paris');
+require_once "testGeneral_common.php";
+final class GeneralTest extends GeneralCommon {
+ public function setUp(): void {
+ $this->common_setUp();
}
-
- /**
- * Méthode lancée en fin de traitement
- */
- public function tearDown() {
-
- //
+ public function tearDown(): void {
+ $this->common_tearDown();
}
-
- /**
- * Test template
- */
- public function test_template() {
- // Instance de la classe Utils
- require_once "../obj/opendebitdeboisson.class.php";
- @session_start();
- $_SESSION['collectivite'] = 1;
- $_SESSION['login'] = "admin";
- $_SERVER['REQUEST_URI'] = "";
- $f = new opendebitdeboisson("nohtml");
- $f->disableLog();
-
- // Test
- $this->assertEquals(true, true);
-
- // Destruction de la classe Utils
- $f->__destruct();
+ public function onNotSuccessfulTest(Throwable $e): void {
+ $this->common_onNotSuccessfulTest($e);
}
-
}

Copied: branches/poc-upgrade-om-4.10/tests/testGeneral_common.php (from rev 399, trunk/tests/testGeneral_common.php)
===================================================================
--- branches/poc-upgrade-om-4.10/tests/testGeneral_common.php (rev 0)
+++ branches/poc-upgrade-om-4.10/tests/testGeneral_common.php 2020-04-15 12:48:47 UTC (rev 400)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Ce script contient la définition de la classe 'GeneralCommon'.
+ *
+ * @package opendebitdeboisson
+ * @version SVN : $Id$
+ */
+
+/**
+ * Cette classe permet de tester unitairement les fonctions de l'application.
+ */
+abstract class GeneralCommon extends PHPUnit\Framework\TestCase {
+
+ /**
+ * Méthode lancée en début de traitement
+ */
+ function common_setUp() {
+ date_default_timezone_set('Europe/Paris');
+ echo ' = '.get_called_class().'.'.str_replace('test_', '', $this->getName())."\r\n";
+ }
+
+ /**
+ * Méthode lancée en fin de traitement
+ */
+ function common_tearDown() {
+ }
+
+ /**
+ * Méthode étant appelée lors du fail d'un test.
+ *
+ * @param $e Exception remontée lors du test
+ * @return void
+ */
+ public function common_onNotSuccessfulTest(Throwable $e) {
+ echo 'Line '.$e->getLine().' : '.$e->getMessage()."\r\n";
+ parent::onNotSuccessfulTest($e);
+ }
+
+ /**
+ * Test template
+ */
+ public function test_template() {
+ // Instanciation de la classe *om_application*
+ require_once "../obj/opendebitdeboisson.class.php";
+ $_POST["login"] = "admin";
+ $_POST["password"] = "admin";
+ $_POST["login_action_connect"] = true;
+ $f = new opendebitdeboisson("login_and_nohtml");
+ $f->disableLog();
+ // Test
+ $this->assertEquals($f->authenticated, true);
+ // Destruction de la classe *om_application*
+ $f->logout();
+ $f->__destruct();
+ }
+}

Copied: branches/poc-upgrade-om-4.10/tests/testGeneral_php70.php (from rev 399, trunk/tests/testGeneral_php70.php)
===================================================================
--- branches/poc-upgrade-om-4.10/tests/testGeneral_php70.php (rev 0)
+++ branches/poc-upgrade-om-4.10/tests/testGeneral_php70.php 2020-04-15 12:48:47 UTC (rev 400)
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Ce script contient la définition de la classe 'GeneralPHP70Test'.
+ *
+ * @package opendebitdeboisson
+ * @version SVN : $Id$
+ */
+
+require_once "testGeneral_common.php";
+final class GeneralPHP70Test extends GeneralCommon {
+ public function setUp() {
+ $this->common_setUp();
+ }
+ public function tearDown() {
+ $this->common_tearDown();
+ }
+ public function onNotSuccessfulTest(Throwable $e) {
+ $this->common_onNotSuccessfulTest($e);
+ }
+}

Reply all
Reply to author
Forward
0 new messages