Skip to content

Commit 5aed043

Browse files
authored
Merge pull request phpbrew#1209 from flavioheleno/patch-1
Fix ExecutablePrefixFinder executable name
2 parents ad346ae + 3a05d4d commit 5aed043

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/PhpBrew/PrefixFinder/ExecutablePrefixFinder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct($name)
2828
*/
2929
public function findPrefix()
3030
{
31-
$bin = Utils::findBin('pg_config');
31+
$bin = Utils::findBin($this->name);
3232

3333
if ($bin === null) {
3434
return null;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace PhpBrew\Tests;
4+
5+
use PhpBrew\PrefixFinder\ExecutablePrefixFinder;
6+
use PHPUnit\Framework\TestCase;
7+
8+
/**
9+
* @group prefixfinder
10+
*/
11+
class ExecutablePrefixFinderTest extends TestCase
12+
{
13+
public function testFindValid()
14+
{
15+
$epf = new ExecutablePrefixFinder('ls');
16+
$this->assertNotNull($epf->findPrefix());
17+
}
18+
19+
public function testFindInvalid()
20+
{
21+
$epf = new ExecutablePrefixFinder('inexistent-binary');
22+
$this->assertNull($epf->findPrefix());
23+
}
24+
}

0 commit comments

Comments
 (0)