Skip to content

Commit 86e1f53

Browse files
authored
Merge pull request #64 from iobotis/set-archive-dir-unit-test
Duplicity "setArchiveDir()" unit test created.
2 parents 15917c3 + dda836d commit 86e1f53

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/Backup/DuplicityTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,33 @@ public function testSetPassPhrase()
153153

154154
}
155155

156+
/**
157+
* Test ArchiveDir(--archive-dir) is set as environment variable.
158+
*
159+
* @throws \Exception
160+
*/
161+
public function testSetArchiveDir()
162+
{
163+
$path = '/path/to/archive/dir';
164+
$this->duplicity = $this->getDuplicityMock(array('getVersion'));
165+
$this->duplicity
166+
->expects($this->any())
167+
->method('getVersion')
168+
->will($this->returnValue('0.6'));
169+
$this->duplicity->setArchiveDir($path);
170+
$this->binary
171+
->expects($this->once())
172+
->method('run')
173+
->with($this->stringContains('--archive-dir=' . $path))
174+
->will($this->returnValue(0));
175+
$this->binary
176+
->expects($this->once())
177+
->method('getOutput')
178+
->will($this->returnValue(array('')));
179+
$this->duplicity->execute();
180+
181+
}
182+
156183
/**
157184
* @group 1
158185
* @dataProvider getCmdCollectionOutput

0 commit comments

Comments
 (0)