Skip to content

Commit

Permalink
Mock filesystem method to avoid errors in travis
Browse files Browse the repository at this point in the history
  • Loading branch information
cpriego committed Apr 22, 2017
1 parent 66db0f6 commit d535053
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/Integration/DnsMasqTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ public function test_dnsmasqSetup_correctly_installs_and_configures_dnsmasq_cont
$pm = Mockery::mock(PackageManager::class);
$pm->shouldReceive('ensureInstalled')->once()->with('dnsmasq');
$sm = Mockery::mock(ServiceManager::class);
$files = Mockery::mock(Filesystem::class);
$files = resolve(StubForFiles::class);

swap(PackageManager::class, $pm);
swap(ServiceManager::class, $sm);
swap(Filesystem::class, $files);

$dnsMasq = resolve(DnsMasq::class);
$dnsMasq->nmConfigPath = __DIR__ . '/output/valet.conf';
Expand Down Expand Up @@ -92,3 +93,11 @@ public function test_update_domain_removes_old_resolver_and_reinstalls()
$dnsMasq->updateDomain('old', 'new');
}
}

class StubForFiles extends Filesystem
{
function ensureDirExists($path, $owner = null, $mode = 0755)
{
return;
}
}

0 comments on commit d535053

Please sign in to comment.