-
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 #4 from illegalstudio/testing-first-step
Testing the package
- Loading branch information
Showing
42 changed files
with
2,107 additions
and
159 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
package-tests: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | ||
with: | ||
php-version: '8.1' | ||
- uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: composer update && composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist && composer dump-autoload | ||
- name: Execute tests (Unit and Feature tests) via PEST | ||
run: vendor/bin/pest |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
composer.lock | ||
node_modules/ | ||
vendor/ | ||
composer.lock |
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,18 @@ | ||
includes: | ||
- ./vendor/nunomaduro/larastan/extension.neon | ||
|
||
parameters: | ||
|
||
paths: | ||
- src/ | ||
|
||
# Level 9 is the highest level | ||
level: 5 | ||
|
||
# ignoreErrors: | ||
# - '#PHPDoc tag @var#' | ||
# | ||
# excludePaths: | ||
# - ./*/*/FileToBeExcluded.php | ||
# | ||
# checkMissingIterableValueType: false |
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,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage/> | ||
<php> | ||
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/> | ||
<env name="DB_CONNECTION" value="testing"/> | ||
</php> | ||
<source> | ||
<include> | ||
<directory>./functions</directory> | ||
<directory>./src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./functions</directory> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
<php> | ||
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/> | ||
<env name="DB_CONNECTION" value="testing"/> | ||
</php> | ||
</phpunit> |
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,52 @@ | ||
<?php | ||
|
||
namespace Illegal\InsideAuth\Contracts; | ||
|
||
use Illegal\InsideAuth\Authenticator; | ||
use Illuminate\Config\Repository; | ||
use Illuminate\Routing\Router; | ||
use Illuminate\Support\Collection; | ||
|
||
abstract class AbstractRegistrator | ||
{ | ||
/** | ||
* @var string The prefix to be used for the parameters | ||
*/ | ||
protected string $prefix = ""; | ||
|
||
/** | ||
* @var string The authName that the registrators should use. | ||
*/ | ||
protected string $authName = "auth"; | ||
|
||
public function __construct(protected readonly Repository $config, protected readonly Router $router) | ||
{ | ||
} | ||
|
||
/** | ||
* Magic getter for parameters | ||
*/ | ||
public abstract function __get(string $key); | ||
|
||
/** | ||
* Setter for the authName | ||
*/ | ||
public function withAuthName($authName): static | ||
{ | ||
$this->authName = $authName; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* This function will collect and merge all parameters inside the provided Authenticator | ||
* @see Authenticator::merge() | ||
*/ | ||
public abstract function collectAndMergeParameters(): Collection; | ||
|
||
/** | ||
* Set of actions to be performed when booting the auth. | ||
* @param Collection $allParameters All the parameters gathered by the authentication system | ||
*/ | ||
public abstract function boot(Collection $allParameters): void; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Illegal\InsideAuth\Factories; | ||
|
||
use Illegal\InsideAuth\Models\User; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class UserFactory extends Factory | ||
{ | ||
protected $model = User::class; | ||
|
||
public function definition(): array | ||
{ | ||
return [ | ||
'name' => $this->faker->name, | ||
'email' => $this->faker->unique()->safeEmail, | ||
'email_verified_at' => now(), | ||
'password' => bcrypt('password'), | ||
]; | ||
} | ||
} |
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
Oops, something went wrong.