fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6769] Added common testing class that other testing


From: Petur Bjorn Thorsteinsson
Subject: [Fmsystem-commits] [6769] Added common testing class that other testing classes can extend
Date: Fri, 14 Jan 2011 13:48:39 +0000

Revision: 6769
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6769
Author:   peturbjorn
Date:     2011-01-14 13:48:39 +0000 (Fri, 14 Jan 2011)
Log Message:
-----------
Added common testing class that other testing classes can extend

Added Paths:
-----------
    branches/dev-bim2/property/tests/BIM/TestBimCommon.php

Added: branches/dev-bim2/property/tests/BIM/TestBimCommon.php
===================================================================
--- branches/dev-bim2/property/tests/BIM/TestBimCommon.php                      
        (rev 0)
+++ branches/dev-bim2/property/tests/BIM/TestBimCommon.php      2011-01-14 
13:48:39 UTC (rev 6769)
@@ -0,0 +1,35 @@
+<?php
+
+class TestBimCommon extends PHPUnit_Framework_TestCase
+{
+       
+       protected $db;
+       // variables for bim model
+       protected $modelName = "unitTestModel";
+       protected $vfsFileName = "dummyFile.txt";
+       protected $vfsFileNameWithFullPath;
+       protected $vfsFileContents = "This is a file made for unit testing, 
please ignore or delete";
+       protected $vfsSubModule = "ifc";
+       protected $vfsFileId = 10101010;
+       
+       public function __construct() {
+               $GLOBALS['phpgw_info']['user']['account_id'] = 7;
+               
+       }
+       
+       protected function initDatabase() {
+               $this->db = & $GLOBALS['phpgw']->db;
+       }
+       
+       protected function createDummyFile() {
+               $currentDirectory = dirname(__FILE__);
+               $this->vfsFileNameWithFullPath = 
$currentDirectory.DIRECTORY_SEPARATOR.$this->vfsFileName;
+               
+               $fileHandle = fopen($this->vfsFileNameWithFullPath, 'w') or 
die("Can't open file");
+               $result = fwrite($fileHandle, $this->vfsFileContents);
+               fclose($fileHandle);
+       }
+       protected function removeDummyFile() {
+               unlink($this->vfsFileNameWithFullPath);
+       }
+}
\ No newline at end of file




reply via email to

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