-
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.
Merge pull request #12 from kirschbaum-development/testing
Testing
- Loading branch information
Showing
25 changed files
with
478 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ composer.phar | |
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
.phpunit.cache | ||
.DS_Store | ||
Thumbs.db | ||
Thumbs.db |
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
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
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,8 @@ | ||
<?php | ||
|
||
namespace Kirschbaum\Paragon\Concerns; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)] | ||
class IgnoreParagon {} |
This file was deleted.
Oops, something went wrong.
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
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,9 @@ | ||
<?php | ||
|
||
use Kirschbaum\Paragon\Concerns\IgnoreParagon; | ||
|
||
arch()->expect(IgnoreParagon::class) | ||
->toExtendNothing(); | ||
|
||
arch()->expect(IgnoreParagon::class) | ||
->toHaveAttribute(Attribute::class); |
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,16 @@ | ||
<?php | ||
|
||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
arch()->expect('Kirschbaum\Paragon\Commands') | ||
->classes() | ||
->toHaveSuffix('Command'); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Commands') | ||
->toHaveAttribute(AsCommand::class); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Commands') | ||
->not->toHavePrivateMethodsBesides(['__construct', 'handle']); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Commands') | ||
->not->toHavePublicMethodsBesides(['__construct', 'handle']); |
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 | ||
|
||
use Kirschbaum\Paragon\Concerns\DiscoverEnums; | ||
|
||
arch()->expect(DiscoverEnums::class) | ||
->toExtendNothing(); | ||
|
||
arch()->expect(DiscoverEnums::class) | ||
->not->toHavePrivateMethodsBesides(['within']); | ||
|
||
arch()->expect(DiscoverEnums::class) | ||
->not->toHavePublicMethodsBesides(['within']); |
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,17 @@ | ||
<?php | ||
|
||
arch()->expect('Kirschbaum\Paragon\Generators') | ||
->classes() | ||
->toHaveSuffix('Generator'); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Generators') | ||
->toExtendNothing(); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Generators') | ||
->toBeInvokable(); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Generators') | ||
->not->toHavePrivateMethodsBesides(['__construct', '__invoke']); | ||
|
||
arch()->expect('Kirschbaum\Paragon\Generators') | ||
->not->toHavePublicMethodsBesides(['__construct', '__invoke']); |
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,29 @@ | ||
<?php | ||
|
||
arch()->preset()->php(); | ||
|
||
// Security without the md5 method as we need it for caching. | ||
arch() | ||
->expect([ | ||
'array_rand', | ||
'assert', | ||
'create_function', | ||
'dl', | ||
'eval', | ||
'exec', | ||
'extract', | ||
'mb_parse_str', | ||
'mt_rand', | ||
'parse_str', | ||
'passthru', | ||
'rand', | ||
'sha1', | ||
'shell_exec', | ||
'shuffle', | ||
'str_shuffle', | ||
'system', | ||
'tempnam', | ||
'uniqid', | ||
'unserialize', | ||
]) | ||
->not->toBeUsed(); |
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,11 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
use Kirschbaum\Paragon\Concerns\IgnoreParagon; | ||
|
||
#[IgnoreParagon] | ||
enum Ignore: string | ||
{ | ||
case Ignore = 'ignore'; | ||
} |
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,8 @@ | ||
<?php | ||
|
||
namespace App\Enums\Ignore; | ||
|
||
enum Ignore | ||
{ | ||
case Ignore; | ||
} |
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,14 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
enum IntegerBacked: int | ||
{ | ||
case Active = 1; | ||
case Inactive = 0; | ||
|
||
public function label(): string | ||
{ | ||
return 'label'; | ||
} | ||
} |
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,8 @@ | ||
<?php | ||
|
||
namespace App\Enums\Nested; | ||
|
||
enum Nested | ||
{ | ||
case Nested; | ||
} |
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,14 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
enum NonBacked | ||
{ | ||
case Active; | ||
case Inactive; | ||
|
||
public function label(): string | ||
{ | ||
return 'label'; | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
use Kirschbaum\Paragon\Concerns\IgnoreParagon; | ||
|
||
enum StringBacked: string | ||
{ | ||
case Active = 'active'; | ||
case Inactive = 'inactive'; | ||
|
||
public function label(): string | ||
{ | ||
return 'label'; | ||
} | ||
|
||
#[IgnoreParagon] | ||
public function ignore(): string | ||
{ | ||
return 'ignore'; | ||
} | ||
|
||
public static function ignoreStatic(): string | ||
{ | ||
return 'ignore'; | ||
} | ||
} |
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,5 @@ | ||
<?php | ||
|
||
use Kirschbaum\Paragon\Tests\TestCase; | ||
|
||
uses(TestCase::class)->in(__DIR__); |
Oops, something went wrong.