Skip to content

Commit

Permalink
Added base name of file as accepted file pattern (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Stadel Linnet authored and greg-1-anderson committed Sep 19, 2018
1 parent 704e908 commit c869c4d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/SiteAliasFileDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public function findAllLegacyAliasFiles()
{
return array_merge(
$this->searchForAliasFiles('*.alias.drushrc.php'),
$this->searchForAliasFiles('*.aliases.drushrc.php')
$this->searchForAliasFiles('*.aliases.drushrc.php'),
$this->searchForAliasFiles('aliases.drushrc.php')
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/SiteAliasFileDiscoveryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testFindAllLegacyAliasFiles()

$result = $this->sut->findAllLegacyAliasFiles();
$paths = $this->simplifyToBasenamesWithLocation($result);
$this->assertEquals('legacy/cc.aliases.drushrc.php,legacy/one.alias.drushrc.php,legacy/pantheon.aliases.drushrc.php,legacy/server.aliases.drushrc.php', implode(',', $paths));
$this->assertEquals('legacy/aliases.drushrc.php,legacy/cc.aliases.drushrc.php,legacy/one.alias.drushrc.php,legacy/pantheon.aliases.drushrc.php,legacy/server.aliases.drushrc.php', implode(',', $paths));
}

protected function assertLocation($expected, $path)
Expand Down
11 changes: 11 additions & 0 deletions tests/fixtures/sitealiases/legacy/aliases.drushrc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$aliases['production'] = [
'uri' => 'example.com',
'root' => '/path/to/drupal',
];

$aliases['staging'] = [
'uri' => 'staging.example.com',
'root' => '/path/to/drupal',
];
3 changes: 3 additions & 0 deletions tests/fixtures/sitealiases/legacy/do-not-find-me.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

// The search scripts shouldn't find me as I do not match the patterns.

0 comments on commit c869c4d

Please sign in to comment.