Skip to content

Commit af8ef47

Browse files
Test binary detection with a command that should be there 'cd'
1 parent eb687a9 commit af8ef47

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/phpbu/Backup/Cli/BinaryTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ public function testAddCommandLocations()
133133
$this->assertEquals('/foo/mongodump', $list[0]);
134134
}
135135

136+
/**
137+
* Tests Binary::detectCommand
138+
*/
139+
public function testDetectCommand()
140+
{
141+
$bin = new BinaryStub();
142+
$cd = $bin->testDetectCommand('cd');
143+
144+
$this->assertTrue(strpos($cd, 'cd') !== false);
145+
$this->assertTrue(is_executable($cd));
146+
}
147+
136148
/**
137149
* Create Target Mock.
138150
*
@@ -225,4 +237,13 @@ public function testExecute(Exec $exec, Target $target, $compressOutput)
225237
$compressor = $compressOutput ? $target->getCompressor() : null;
226238
return $this->execute($exec, $target->getPathnamePlain(), $compressor);
227239
}
240+
241+
/**
242+
* @param string $cmd
243+
* @return string
244+
*/
245+
public function testDetectCommand($cmd)
246+
{
247+
return $this->detectCommand($cmd);
248+
}
228249
}

0 commit comments

Comments
 (0)