summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorKlap-in <klapinklapin@gmail.com>2013-08-01 23:26:13 +0200
committerKlap-in <klapinklapin@gmail.com>2013-08-01 23:26:13 +0200
commit58968e9b7439a1a1ad9f5f211bab88feeff762a0 (patch)
tree2b887014726165ab492312c4b9cfb52545e37ffa /_test
parentde489e8bb4161522864aca1d308b9910387ae4bb (diff)
parent4f93eef69523dad1ba27c5ac5465b037c598ff18 (diff)
downloadrpg-58968e9b7439a1a1ad9f5f211bab88feeff762a0.tar.gz
rpg-58968e9b7439a1a1ad9f5f211bab88feeff762a0.tar.bz2
Merge remote-tracking branch 'origin/master' into fetchimagetokexternal
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/tar.test.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php
index 28e709cc3..50664cfc3 100644
--- a/_test/tests/inc/tar.test.php
+++ b/_test/tests/inc/tar.test.php
@@ -11,7 +11,8 @@ class Tar_TestCase extends DokuWikiTest {
public function test_createdynamic() {
$tar = new Tar();
- $dir = dirname(__FILE__).'/tar';
+ $dir = dirname(__FILE__).'/tar';
+ $tdir = ltrim($dir,'/');
$tar->create();
$tar->AddFile("$dir/testdata1.txt");
@@ -24,11 +25,11 @@ class Tar_TestCase extends DokuWikiTest {
$this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, "$dir/testdata1.txt") !== false, 'Path in TAR');
+ $this->assertTrue(strpos($data, "$tdir/testdata1.txt") !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, "$dir/foobar/testdata2.txt") === false, 'Path not in TAR');
+ $this->assertTrue(strpos($data, "$tdir/foobar/testdata2.txt") === false, 'Path not in TAR');
$this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
}
@@ -42,6 +43,7 @@ class Tar_TestCase extends DokuWikiTest {
$tar = new Tar();
$dir = dirname(__FILE__).'/tar';
+ $tdir = ltrim($dir,'/');
$tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
$tar->create($tmp, Tar::COMPRESS_NONE);
@@ -57,11 +59,11 @@ class Tar_TestCase extends DokuWikiTest {
$this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, "$dir/testdata1.txt") !== false, 'Path in TAR');
+ $this->assertTrue(strpos($data, "$tdir/testdata1.txt") !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, "$dir/foobar/testdata2.txt") === false, 'Path not in TAR');
+ $this->assertTrue(strpos($data, "$tdir/foobar/testdata2.txt") === false, 'Path not in TAR');
$this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
@unlink($tmp);