[opendebitdeboisson-commits] r366 - trunk/tests

0 views
Skip to first unread message

fmi...@adullact.net

unread,
May 29, 2019, 8:46:00 AM5/29/19
to openmairie-ope...@googlegroups.com
Author: fmichon
Date: 2019-05-29 14:45:59 +0200 (Wed, 29 May 2019)
New Revision: 366

Added:
trunk/tests/bootstrap.php
trunk/tests/config.xml
trunk/tests/testGeneral.php
Log:
* Tests unitaires PHPUnit.


Added: trunk/tests/bootstrap.php
===================================================================
--- trunk/tests/bootstrap.php (rev 0)
+++ trunk/tests/bootstrap.php 2019-05-29 12:45:59 UTC (rev 366)
@@ -0,0 +1,2 @@
+<?php
+session_start();

Added: trunk/tests/config.xml
===================================================================
--- trunk/tests/config.xml (rev 0)
+++ trunk/tests/config.xml 2019-05-29 12:45:59 UTC (rev 366)
@@ -0,0 +1,7 @@
+<phpunit>
+ <testsuites>
+ <testsuite name="opendebitdeboisson">
+ <file>testGeneral.php</file>
+ </testsuite>
+ </testsuites>
+</phpunit>

Added: trunk/tests/testGeneral.php
===================================================================
--- trunk/tests/testGeneral.php (rev 0)
+++ trunk/tests/testGeneral.php 2019-05-29 12:45:59 UTC (rev 366)
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Tests unitaires PHPUnit.
+ *
+ * @package opendebitdeboisson
+ * @version SVN : $Id$
+ */
+
+/**
+ * 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');
+ }
+
+ /**
+ * Méthode lancée en fin de traitement
+ */
+ public function 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();
+ }
+
+}

Reply all
Reply to author
Forward
0 new messages