diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-08-01 23:19:25 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-08-01 23:23:41 +0200 |
commit | 4f93eef69523dad1ba27c5ac5465b037c598ff18 (patch) | |
tree | 5499191bad4c2c517bb6ab033162fae86c42eafd /_test/tests | |
parent | 8e3ca8dae2a45ba098e47691cf87f5b53d3442bd (diff) | |
download | rpg-4f93eef69523dad1ba27c5ac5465b037c598ff18.tar.gz rpg-4f93eef69523dad1ba27c5ac5465b037c598ff18.tar.bz2 |
fixed tar tests FS#2809
Tars strip the leading slash so the tests where wrong. Not sure why they
stilldid work sometimes
Diffstat (limited to '_test/tests')
-rw-r--r-- | _test/tests/inc/tar.test.php | 12 |
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); |