Skip to content

Commit eb687a9

Browse files
Use fake tar binary for unit testing
1 parent b8abfbc commit eb687a9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/phpbu/Backup/Source/TarTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,29 @@ public function testSetupPathMissing()
5151
$this->assertFalse(true, 'exception should be thrown');
5252
}
5353

54+
/**
55+
* Tests Tar::setUp
56+
*
57+
* @expectedException \RuntimeException
58+
*/
59+
public function testSetUpCantFindBinary()
60+
{
61+
$mcrypt = new Tar();
62+
$mcrypt->setup(array('path' => '/tmp', 'pathToTar' => '/foo/bar'));
63+
}
64+
65+
/**
66+
* Tests Tar::setUp
67+
*/
68+
public function testSetUpFindBinary()
69+
{
70+
$path = realpath(__DIR__ . '/../../../_files/bin');
71+
$mcrypt = new Tar();
72+
$mcrypt->setup(array('path' => '/tmp', 'pathToTar' => $path));
73+
74+
$this->assertTrue(true, 'no exception should be thrown');
75+
}
76+
5477
/**
5578
* Tests Tar::getExec
5679
*/

0 commit comments

Comments
 (0)