From dda836dcf955efb97545819aa2d53e8e4c8e55aa Mon Sep 17 00:00:00 2001 From: iobotis Date: Fri, 15 Sep 2017 10:50:47 +0300 Subject: [PATCH] Duplicity "setArchiveDir()" unit test created. --- tests/Backup/DuplicityTest.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/Backup/DuplicityTest.php b/tests/Backup/DuplicityTest.php index 3a61aae..67ce890 100644 --- a/tests/Backup/DuplicityTest.php +++ b/tests/Backup/DuplicityTest.php @@ -153,6 +153,33 @@ public function testSetPassPhrase() } + /** + * Test ArchiveDir(--archive-dir) is set as environment variable. + * + * @throws \Exception + */ + public function testSetArchiveDir() + { + $path = '/path/to/archive/dir'; + $this->duplicity = $this->getDuplicityMock(array('getVersion')); + $this->duplicity + ->expects($this->any()) + ->method('getVersion') + ->will($this->returnValue('0.6')); + $this->duplicity->setArchiveDir($path); + $this->binary + ->expects($this->once()) + ->method('run') + ->with($this->stringContains('--archive-dir=' . $path)) + ->will($this->returnValue(0)); + $this->binary + ->expects($this->once()) + ->method('getOutput') + ->will($this->returnValue(array(''))); + $this->duplicity->execute(); + + } + /** * @group 1 * @dataProvider getCmdCollectionOutput