-
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
…ions-2 BUPH-92 | Multiple single line annotations
- Loading branch information
Showing
16 changed files
with
207 additions
and
1 deletion.
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/* |
12 changes: 12 additions & 0 deletions
12
tests/v1/DefaultAnnotationContents/control/DefaultContents.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,12 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTest; | ||
|
||
class DefaultContents | ||
{ | ||
public const TEST_STRING =<<<EOC | ||
This is a default string | ||
EOC; | ||
} |
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/DefaultAnnotationContents/src/DefaultContents.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>.php: | ||
template: PrimaryActorName.php |
13 changes: 13 additions & 0 deletions
13
tests/v1/DefaultAnnotationContents/templates/PrimaryActorName.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,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTemplateTree; | ||
|
||
class PrimaryActorName | ||
{ | ||
public const TEST_STRING =<<<EOC | ||
/** @neighborhoods-buphalo:annotation-processor Test Default Annotation Processor with white space in name | ||
This is a default string | ||
*/ | ||
EOC; | ||
} |
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/* |
12 changes: 12 additions & 0 deletions
12
tests/v2/DefaultAnnotationContents/control/DefaultContents.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,12 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTest; | ||
|
||
class DefaultContents | ||
{ | ||
public const TEST_STRING =<<<EOC | ||
This is a default string | ||
EOC; | ||
} |
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_V2_TargetApplication_BuilderInterface__SourceDirectoryPath=$PWD/src"); | ||
putenv("Neighborhoods_Buphalo_V2_TargetApplication_BuilderInterface__FabricationDirectoryPath=$PWD/fab"); | ||
putenv("Neighborhoods_Buphalo_V2_TargetApplication_BuilderInterface__NamespacePrefix=Neighborhoods\\BuphaloTest"); | ||
putenv("Neighborhoods_Buphalo_V2_TemplateTree_Map_Builder_FactoryInterface__TemplateTreeDirectoryPaths=$PWD/templates"); | ||
|
||
// Include Buphalo | ||
require_once($PWD . '/../../../bin/v2/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/v2/DefaultAnnotationContents/src/DefaultContents.buphalo.v2.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>.php: | ||
template: PrimaryActorName.php |
13 changes: 13 additions & 0 deletions
13
tests/v2/DefaultAnnotationContents/templates/PrimaryActorName.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,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTemplateTree; | ||
|
||
class PrimaryActorName | ||
{ | ||
public const TEST_STRING =<<<EOC | ||
/** @neighborhoods-buphalo:annotation-processor TestDefaultAnnotationProcessorNoWhitespaceAllowed | ||
This is a default string | ||
*/ | ||
EOC; | ||
} |
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/* |
13 changes: 13 additions & 0 deletions
13
tests/v2/MultipleSingleLineAPs/control/MultipleSingleLine.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,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTest; | ||
|
||
class MultipleSingleLine | ||
{ | ||
public const TEST_STRING = ''; | ||
|
||
public const IN_BETWEEN = 'in_between'; | ||
|
||
public const SECOND = 'second'; | ||
} |
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; | ||
} else if (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_V2_TargetApplication_BuilderInterface__SourceDirectoryPath=$PWD/src"); | ||
putenv("Neighborhoods_Buphalo_V2_TargetApplication_BuilderInterface__FabricationDirectoryPath=$PWD/fab"); | ||
putenv("Neighborhoods_Buphalo_V2_TargetApplication_BuilderInterface__NamespacePrefix=Neighborhoods\\BuphaloTest"); | ||
putenv("Neighborhoods_Buphalo_V2_TemplateTree_Map_Builder_FactoryInterface__TemplateTreeDirectoryPaths=$PWD/templates"); | ||
|
||
// Include Buphalo | ||
require_once($PWD . '/../../../bin/v2/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); | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/v2/MultipleSingleLineAPs/src/MultipleSingleLine.buphalo.v2.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,10 @@ | ||
actors: | ||
<PrimaryActorName>.php: | ||
template: PrimaryActorName.php | ||
annotation_processors: | ||
FirstAnnotation: | ||
processor_fqcn: \Neighborhoods\Buphalo\V2\AnnotationProcessors\EmptyString | ||
SecondAnnotation: | ||
processor_fqcn: \Neighborhoods\Buphalo\V2\AnnotationProcessors\SimpleString | ||
static_context_record: | ||
string: "public const SECOND = 'second';" |
13 changes: 13 additions & 0 deletions
13
tests/v2/MultipleSingleLineAPs/templates/PrimaryActorName.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,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\BuphaloTemplateTree; | ||
|
||
class PrimaryActorName | ||
{ | ||
public const TEST_STRING = '/** @neighborhoods-buphalo:annotation-processor FirstAnnotation */'; | ||
|
||
public const IN_BETWEEN = 'in_between'; | ||
|
||
/** @neighborhoods-buphalo:annotation-processor SecondAnnotation */ | ||
} |