-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…its-1x BUPH-75 | Support Fully Qualified Traits [1.x]
- Loading branch information
Showing
6 changed files
with
65 additions
and
4 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 @@ | ||
fab/* |
10 changes: 10 additions & 0 deletions
10
tests/v1/FullyQualifiedTraits/control/Fully/QualifiedTrait/Handler.php
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,10 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTest\Fully\QualifiedTrait; | ||
|
||
class Handler implements HandlerInterface | ||
{ | ||
use \Neighborhoods\BuphaloTest\NonPrimaryActor\AwareTrait; | ||
use \Neighborhoods\BuphaloTest\Fully\QualifiedTrait\Map\Repository\AwareTrait; | ||
} |
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,37 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
declare(strict_types=1); | ||
error_reporting(E_ALL); | ||
|
||
$PWD = __DIR__; | ||
|
||
// Must load autoloader before including any Annotation Processors | ||
if (file_exists($autoloaderFilePath = dirname($PWD, 5) . '/autoload.php')) { | ||
/** @noinspection PhpIncludeInspection */ | ||
require_once $autoloaderFilePath; | ||
} elseif (file_exists($autoloaderFilePath = dirname($PWD, 3) . '/vendor/autoload.php')) { | ||
/** @noinspection PhpIncludeInspection */ | ||
require_once $autoloaderFilePath; | ||
} else { | ||
throw new RuntimeException('Unable to find the Composer autoloader.'); | ||
} | ||
|
||
// Include Annotation Processors for Buphalo | ||
// None for this test | ||
|
||
// Add exec envs | ||
putenv("Neighborhoods_Buphalo_V1_TargetApplication_BuilderInterface__SourceDirectoryPath=$PWD/src"); | ||
putenv("Neighborhoods_Buphalo_V1_TargetApplication_BuilderInterface__FabricationDirectoryPath=$PWD/fab"); | ||
putenv("Neighborhoods_Buphalo_V1_TargetApplication_BuilderInterface__NamespacePrefix=Neighborhoods\\BuphaloTest"); | ||
putenv("Neighborhoods_Buphalo_V1_TemplateTree_Map_Builder_FactoryInterface__TemplateTreeDirectoryPaths=$PWD/templates"); | ||
|
||
// Include Buphalo | ||
require_once($PWD . '/../../../bin/v1/buphalo.php'); | ||
|
||
// Diff the two directories | ||
exec("diff -r $PWD/control/ $PWD/fab/", $output, $return); | ||
|
||
if ($return) { | ||
echo(implode(PHP_EOL, $output) . PHP_EOL); | ||
die(1); | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/v1/FullyQualifiedTraits/src/Fully/QualifiedTrait.buphalo.v1.fabrication.yml
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,3 @@ | ||
actors: | ||
<PrimaryActorName>/Handler.php: | ||
template: PrimaryActorName/Handler.php |
10 changes: 10 additions & 0 deletions
10
tests/v1/FullyQualifiedTraits/templates/PrimaryActorName/Handler.php
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,10 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTemplateTree\PrimaryActorName; | ||
|
||
class Handler implements HandlerInterface | ||
{ | ||
use \Neighborhoods\BuphaloTemplateTree\NonPrimaryActor\AwareTrait; | ||
use \Neighborhoods\BuphaloTemplateTree\PrimaryActorName\Map\Repository\AwareTrait; | ||
} |