-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use fake composer class when the autoload file does not exist
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Facade\Ignition\Support; | ||
|
||
class FakeComposer | ||
{ | ||
public function getClassMap() | ||
{ | ||
return []; | ||
} | ||
|
||
public function getPrefixes() | ||
{ | ||
return []; | ||
} | ||
|
||
public function getPrefixesPsr4() | ||
{ | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Facade\Ignition\Tests\Support; | ||
|
||
use Facade\Ignition\Support\ComposerClassMap; | ||
use Facade\Ignition\Tests\TestCase; | ||
|
||
class ComposerClassMapTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_uses_fake_classmap_if_the_autoloader_does_not_exist() | ||
{ | ||
$classMap = new ComposerClassMap('invalid'); | ||
|
||
$this->assertSame([], $classMap->listClasses()); | ||
$this->assertSame([], $classMap->listClassesInPsrMaps()); | ||
$this->assertNull($classMap->searchClassMap('SomeClass')); | ||
$this->assertNull($classMap->searchPsrMaps('SomeClass')); | ||
} | ||
} |