phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r685 - trunk/transform/unit-test


From: phpcompta-dev
Subject: [Phpcompta-dev] r685 - trunk/transform/unit-test
Date: Sat, 1 Feb 2014 22:24:58 +0100 (CET)

Author: danydb
Date: 2014-02-01 22:24:58 +0100 (Sat, 01 Feb 2014)
New Revision: 685

Modified:
   trunk/transform/unit-test/transform_IntervatTest.php
Log:
Backup global : phpunit reset automatically the global variables

Modified: trunk/transform/unit-test/transform_IntervatTest.php
===================================================================
--- trunk/transform/unit-test/transform_IntervatTest.php        2014-02-01 
21:18:27 UTC (rev 684)
+++ trunk/transform/unit-test/transform_IntervatTest.php        2014-02-01 
21:24:58 UTC (rev 685)
@@ -3,7 +3,7 @@
 /**
  * Testing of class_intervat
  *  phpunit-skelgen --bootstrap bootstrap.php --test -- Intervat 
../include/class_transform_intervat.php
- * phpunit  --colors --bootstrap bootstrap.php transform_IntervatTest.php 
+ * phpunit  --tap --colors --bootstrap bootstrap.php 
transform_IntervatTest.php 
  * @author dany
  * Expected result
  * @code
@@ -51,7 +51,10 @@
 
 require_once 'class_transform_representative.php';
 require_once 'class_dossier.php';
-
+global $cn, $g_parameter;
+        $cn = new Database(26);
+        $g_parameter = new Own($cn);
+        $_REQUEST['gDossier'] = 26;
 /**
  * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-01-25 at 18:01:08.
  */
@@ -109,10 +112,7 @@
   </ns2:ClientListing>
 </ns2:ClientListingConsignment>
 ';
-        global $cn, $g_parameter;
-        $cn = new Database(26);
-        $g_parameter = new Own($cn);
-        $_REQUEST['gDossier'] = 26;
+        
         $this->request = new Transform_Request_SQL;
         $this->request->r_type = 'phpunit-intervat';
         $this->request->insert();
@@ -157,15 +157,11 @@
 
     /**
      * @covers Intervat::append_root
-     * @todo   Implement testAppend_root().
      * @backupGlobals enabled
+     * @todo   Implement testAppend_root().
      */
     public function testAppend_root()
     {
-        global $cn, $g_parameter;
-        $cn = new Database(26);
-        $g_parameter = new Own($cn);
-        $_REQUEST['gDossier'] = 26;
         $this->object->append_root();
         $result = $this->object->domdoc->saveXML();
         $must_march = '<?xml version="1.0" encoding="ISO-8859-1"?>     
@@ -177,11 +173,13 @@
         $this->assertContains('ClientListingsNbr="1"', $result);
     }
 
+    /**
+     * @covers Intervat::append_representative
+     * @backupGlobals enabled
+     * @todo   Implement testAppend_representative().
+     */
     public function testAppend_representative()
     {
-           global $cn, $g_parameter;
-        $cn = new Database(26);
-        $g_parameter = new Own($cn);
         $_REQUEST['gDossier'] = 26;
         $this->object->append_root();
         $this->object->append_representative($this->representative);
@@ -191,14 +189,11 @@
 
     /**
      * @covers Intervat::append_client_listing
+     * @backupGlobals enabled
      * @todo   Implement testAppend_client_listing().
      */
     public function testAppend_client_listing()
     {
-           global $cn, $g_parameter;
-        $cn = new Database(26);
-        $g_parameter = new Own($cn);
-        $_REQUEST['gDossier'] = 26;
         $this->object->append_root();
         $this->object->append_representative($this->representative);
         $this->object->append_client_listing($this->declarant);
@@ -208,14 +203,11 @@
 
     /**
      * @covers Intervat::append_declarant
+     * @backupGlobals enabled
      * @todo   Implement testAppend_declarant().
      */
     public function testAppend_declarant()
     {
-           global $cn, $g_parameter;
-        $cn = new Database(26);
-        $g_parameter = new Own($cn);
-        $_REQUEST['gDossier'] = 26;
         $this->object->append_root();
         $dom = $this->object->domdoc->createElement("Listing");
         $this->object->append_declarant($dom, $this->declarant);
@@ -245,8 +237,3 @@
     }
 
 }
-/*
-$a = new IntervatTest;
-$a->call_inline();
-$a->testAppend_representative();
-*/
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]