[Pkg-owncloud-commits] [php-sabre-vobject] 09/128: Write into temp dir to keep repository clean

David Prévot taffit at moszumanska.debian.org
Tue May 20 23:10:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 0696926e64333500e8f933a4ea5fc4c5ab9b5464
Author: Jan Pieper <jan.pieper at adcloud.com>
Date:   Thu Dec 5 12:34:03 2013 +0100

    Write into temp dir to keep repository clean
---
 .gitignore                      | 1 +
 tests/Sabre/VObject/CliTest.php | 7 +++++--
 tests/bootstrap.php             | 8 ++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index a6de316..b9fc2d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 vendor/
 composer.lock
 tests/cov/
+tests/temp
 
 #vim
 .*.swp
diff --git a/tests/Sabre/VObject/CliTest.php b/tests/Sabre/VObject/CliTest.php
index a00719b..23e5319 100644
--- a/tests/Sabre/VObject/CliTest.php
+++ b/tests/Sabre/VObject/CliTest.php
@@ -302,10 +302,11 @@ VCF;
     public function testConvertDefaultFormats() {
 
         $inputStream = fopen('php://memory','r+');
+        $outputFile = SABRE_TEMPDIR . 'bar.json';
 
         $this->assertEquals(
             2,
-            $this->cli->main(array('vobject', 'convert','foo.json','bar.json'))
+            $this->cli->main(array('vobject', 'convert','foo.json',$outputFile))
         );
 
         $this->assertEquals('json', $this->cli->inputFormat);
@@ -315,9 +316,11 @@ VCF;
 
     public function testConvertDefaultFormats2() {
 
+        $outputFile = SABRE_TEMPDIR . 'bar.ics';
+
         $this->assertEquals(
             2,
-            $this->cli->main(array('vobject', 'convert','foo.ics','bar.ics'))
+            $this->cli->main(array('vobject', 'convert','foo.ics',$outputFile))
         );
 
         $this->assertEquals('mimedir', $this->cli->inputFormat);
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 3608abe..e89e9a2 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -13,3 +13,11 @@ foreach($try as $path) {
         break;
     }
 }
+
+if (!defined('SABRE_TEMPDIR')) {
+  define('SABRE_TEMPDIR', __DIR__ . '/temp/');
+}
+
+if (!file_exists(SABRE_TEMPDIR)) {
+  mkdir(SABRE_TEMPDIR);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list