/[openfoncier]/trunk/tests/testDigitalizedDocument.php
ViewVC logotype

Diff of /trunk/tests/testDigitalizedDocument.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4526 by nmeucci, Wed Jun 22 08:18:23 2016 UTC revision 6565 by softime, Fri Apr 21 16:14:15 2017 UTC
# Line 58  class DigitalizedDocumentTest extends PH Line 58  class DigitalizedDocumentTest extends PH
58          unlink('../var/digitalization/Todo/PC0130551200001.P0/20091106AUTPCP-1.pdf');          unlink('../var/digitalization/Todo/PC0130551200001.P0/20091106AUTPCP-1.pdf');
59          unlink('../var/digitalization/Todo/PA0130551200001/20091106AUTPCP.pdf');          unlink('../var/digitalization/Todo/PA0130551200001/20091106AUTPCP.pdf');
60          unlink('../var/digitalization/Todo/PA0130551200001/20091106AUTPCP-1.pdf');          unlink('../var/digitalization/Todo/PA0130551200001/20091106AUTPCP-1.pdf');
61            
62          // Suppression des dossiers PC0130551200001.P0 et PC0130551200002.P0          // Suppression des dossiers PC0130551200001.P0 et PC0130551200002.P0
63          if(file_exists('../var/digitalization/Todo/PC0130551200001.P0')) {          if(file_exists('../var/digitalization/Todo/PC0130551200001.P0')) {
64              rmdir('../var/digitalization/Todo/PC0130551200001.P0');              rmdir('../var/digitalization/Todo/PC0130551200001.P0');
# Line 115  class DigitalizedDocumentTest extends PH Line 116  class DigitalizedDocumentTest extends PH
116                  FROM ".DB_PREFIXE."document_numerise                  FROM ".DB_PREFIXE."document_numerise
117                  WHERE uid = '".$uid."'";                  WHERE uid = '".$uid."'";
118          $document_numerise = $this->digitalizedDocument->f->db->getOne($sql);          $document_numerise = $this->digitalizedDocument->f->db->getOne($sql);
         $this->digitalizedDocument->f->addToLog("tests/testDigitalizedDocument.php : db->getOne(".$sql.")", VERBOSE_MODE);  
119          $this->digitalizedDocument->f->isDatabaseError($document_numerise);          $this->digitalizedDocument->f->isDatabaseError($document_numerise);
120    
121          //Si le lien a été trouvé on retourne vrai          //Si le lien a été trouvé on retourne vrai
# Line 139  class DigitalizedDocumentTest extends PH Line 139  class DigitalizedDocumentTest extends PH
139                  FROM ".DB_PREFIXE."document_numerise                  FROM ".DB_PREFIXE."document_numerise
140                  WHERE document_numerise = '".$document_numerise."'";                  WHERE document_numerise = '".$document_numerise."'";
141          $uid = $this->digitalizedDocument->f->db->getOne($sql);          $uid = $this->digitalizedDocument->f->db->getOne($sql);
         $this->digitalizedDocument->f->addToLog("tests/testDigitalizedDocument.php : db->getOne(".$sql.")", VERBOSE_MODE);  
142          $this->digitalizedDocument->f->isDatabaseError($uid);          $this->digitalizedDocument->f->isDatabaseError($uid);
143    
144          //          //
# Line 247  class DigitalizedDocumentTest extends PH Line 246  class DigitalizedDocumentTest extends PH
246       * Test la fonction createFileTemporary       * Test la fonction createFileTemporary
247       */       */
248      public function testCreateFileTemporary() {      public function testCreateFileTemporary() {
249        
250            // XXX hack temporaire : la commande suivante permet de ne pas avoir d'erreurs de
251            // permissions système dues à l'enchaînement des tests *testREST.php* et
252            // *testDigitalizedDocument.php*
253            exec("sudo chmod 777 -R ../var > /dev/null 2>&1");
254    
255          //Nom possible d'un répertoire          //Nom possible d'un répertoire
256          $foldername = "PC0130551200001.P0";          $foldername = "PC0130551200001.P0";
257          $foldername_no_p0 = "PA0130551200001";          $foldername_no_p0 = "PA0130551200001";
# Line 495  class DigitalizedDocumentTest extends PH Line 499  class DigitalizedDocumentTest extends PH
499       * Test la fonction run_purge       * Test la fonction run_purge
500       */       */
501      public function test_run_purge() {      public function test_run_purge() {
502            copy('binary_files/20091106AUTPCP.pdf', '../var/digitalization/Todo/PC0130551200001.P0/20091106AUTPCP.pdf');
503            copy('binary_files/20091106AUTPCP-1.pdf', '../var/digitalization/Todo/PC0130551200001.P0/20091106AUTPCP-1.pdf');
504            copy('binary_files/20091106AUTPCP.pdf', '../var/digitalization/Todo/PA0130551200001/20091106AUTPCP.pdf');
505            copy('binary_files/20091106AUTPCP-1.pdf', '../var/digitalization/Todo/PA0130551200001/20091106AUTPCP-1.pdf');
506          //Dossier source          //Dossier source
507          $pathSrc = "../var/digitalization/Todo/PC0130551200001.P0";          $pathSrc = "../var/digitalization/Todo/PC0130551200001.P0";
508          $pathSrc_no_p0 = "../var/digitalization/Todo/PA0130551200001";          $pathSrc_no_p0 = "../var/digitalization/Todo/PA0130551200001";

Legend:
Removed from v.4526  
changed lines
  Added in v.6565

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26