diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60d3993..45c97ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,12 @@ on: push: branches: [ "develop" ] pull_request: - branches: [ "develop" ] + types: + - opened + - reopened + - synchronize + - ready_for_review + - review_requested permissions: contents: write @@ -16,7 +21,7 @@ jobs: build: runs-on: ubuntu-latest - + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} steps: - name: Preparing timer id: timer_start @@ -83,7 +88,7 @@ jobs: } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run php-actions/composer@v6 uses: php-actions/composer@v6 with: @@ -96,7 +101,7 @@ jobs: with: version: "10.1" php_version: "8.2" - php_extensions: xdebug + php_extensions: intl xdebug coverage_clover: clover.xml coverage_text: true - name: Make code coverage badge @@ -112,6 +117,12 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} user_name: 'github-actions[bot]' user_email: 'github-actions[bot]@users.noreply.github.com' + - uses: php-actions/phpstan@v3 + with: + level: 9 + php_version: "8.2" + path: config/ database/ src/ tests/Unit/ tests/Feature/ + args: --verbose --debug - name: Stopping timer if: ${{ !cancelled() }} id: timer_end diff --git a/.php-cs-fixer.dist b/.php-cs-fixer.dist.php similarity index 98% rename from .php-cs-fixer.dist rename to .php-cs-fixer.dist.php index 801450d..7c2849b 100644 --- a/.php-cs-fixer.dist +++ b/.php-cs-fixer.dist.php @@ -213,10 +213,10 @@ $finder = PhpCsFixer\Finder::create() ->in([ - __DIR__ . '/config', - __DIR__ . '/database', - __DIR__ . '/src', - __DIR__ . '/tests/Feature', + __DIR__.'/config', + __DIR__.'/database', + __DIR__.'/src', + __DIR__.'/tests/Feature', __DIR__ . '/tests/Unit', ]) ->name('*.php') diff --git a/README.md b/README.md index 9266bfd..bfaa479 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Playground CI Workflow](https://github.com/gammamatrix/playground-matrix/actions/workflows/ci.yml/badge.svg?branch=develop)](https://raw.githubusercontent.com/gammamatrix/playground-matrix/testing/develop/testdox.txt) [![Test Coverage](https://raw.githubusercontent.com/gammamatrix/playground-matrix/testing/develop/coverage.svg)](tests) +[![PHPStan Level 9](https://img.shields.io/badge/PHPStan-level%209-brightgreen)](.github/workflows/ci.yml#L120) The Playground Matrix is a package for [Laravel](https://laravel.com/docs/10.x) applications. @@ -15,6 +16,12 @@ You can install the package via composer: composer require gammamatrix/playground-matrix ``` +## `artisan:about` + +Playground Matrix provides information in the `artisan about` command. + +screenshot of artisan about command with Playground Matrix. + ## Configuration Migrations are disabled by default. This package may sometimes be installed where another system handles the migrations. @@ -23,7 +30,7 @@ See the contents of the published config file: [config/playground-matrix.php](co You can publish the config file with: ```bash -php artisan vendor:publish --provider="GammaMatrix\Playground\Matrix\ServiceProvider" --tag="playground-config" +php artisan vendor:publish --provider="Playground\Matrix\ServiceProvider" --tag="playground-config" ``` ### Environment Variables @@ -61,16 +68,29 @@ See the contents of the published config file: [database/migrations](database/mi You can publish the migrations file with: ```bash -php artisan vendor:publish --provider="GammaMatrix\Playground\Matrix\ServiceProvider" --tag="playground-migrations" +php artisan vendor:publish --provider="Playground\Matrix\ServiceProvider" --tag="playground-migrations" ``` -## About +## PHPStan -Playground Matrix provides information in the `artisan about` command. +Tests at level 9 on: +- `config/` +- `database/` +- `src/` +- `tests/Feature/` +- `tests/Unit/` -screenshot of artisan about command with Playground Matrix. +```sh +composer analyse +``` -## Tests +## Coding Standards + +```sh +composer format +``` + +## Testing ```sh composer test @@ -79,3 +99,11 @@ composer test ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. + +## Credits + +- [Jeremy Postlethwaite](https://github.com/gammamatrix) + +## License + +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/composer.json b/composer.json index 65cc153..45a50ad 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,10 @@ ], "require": { "php": "^8.1", - "gammamatrix/playground": "dev-develop|dev-master|^73.0" + "gammamatrix/playground": "dev-develop|dev-master|dev-feature/*|^73.0" }, "require-dev": { - "gammamatrix/playground-test": "dev-develop|dev-master|^73.0" + "gammamatrix/playground-test": "dev-develop|dev-master|dev-feature/*|^73.0" }, "suggest": { "gammamatrix/playground-matrix-resource": "Provides a resource API and optional Blade UI to interact with the models provided in this package." @@ -32,14 +32,14 @@ "prefer-stable": true, "autoload": { "psr-4": { - "Database\\Factories\\GammaMatrix\\Playground\\Matrix\\Models\\": "database/factories/", - "GammaMatrix\\Playground\\Matrix\\": "src/" + "Database\\Factories\\Playground\\Matrix\\Models\\": "database/factories/", + "Playground\\Matrix\\": "src/" } }, "autoload-dev": { "psr-4": { - "Tests\\Feature\\GammaMatrix\\Playground\\Matrix\\": "tests/Feature/", - "Tests\\Unit\\GammaMatrix\\Playground\\Matrix\\": "tests/Unit/" + "Tests\\Feature\\Playground\\Matrix\\": "tests/Feature/", + "Tests\\Unit\\Playground\\Matrix\\": "tests/Unit/" } }, "config": { @@ -56,13 +56,13 @@ }, "laravel": { "providers": [ - "GammaMatrix\\Playground\\Matrix\\ServiceProvider" + "Playground\\Matrix\\ServiceProvider" ] } }, "scripts": { - "test": "phpunit", - "format": "php-cs-fixer fix --allow-risky=yes", - "analyse": "phpstan analyse" + "test": "vendor/bin/phpunit", + "format": "vendor/bin/php-cs-fixer fix", + "analyse": "vendor/bin/phpstan analyse --verbose --debug --level max" } } diff --git a/database/factories/BacklogFactory.php b/database/factories/BacklogFactory.php index 9268e4a..232326d 100644 --- a/database/factories/BacklogFactory.php +++ b/database/factories/BacklogFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class BacklogFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Backlog::class; + protected $model = Backlog::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class BacklogFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/BoardFactory.php b/database/factories/BoardFactory.php index 234f8fa..b9dc19e 100644 --- a/database/factories/BoardFactory.php +++ b/database/factories/BoardFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class BoardFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Board::class; + protected $model = Board::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class BoardFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/EpicFactory.php b/database/factories/EpicFactory.php index 3e9d8a9..8e2a3da 100644 --- a/database/factories/EpicFactory.php +++ b/database/factories/EpicFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class EpicFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Epic::class; + protected $model = Epic::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class EpicFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/FlowFactory.php b/database/factories/FlowFactory.php index 342c76e..6a334e1 100644 --- a/database/factories/FlowFactory.php +++ b/database/factories/FlowFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class FlowFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Flow::class; + protected $model = Flow::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class FlowFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/MilestoneFactory.php b/database/factories/MilestoneFactory.php index 693dd45..73c7f35 100644 --- a/database/factories/MilestoneFactory.php +++ b/database/factories/MilestoneFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class MilestoneFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Milestone::class; + protected $model = Milestone::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class MilestoneFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/NoteFactory.php b/database/factories/NoteFactory.php index 029d11b..041c68b 100644 --- a/database/factories/NoteFactory.php +++ b/database/factories/NoteFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class NoteFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Note::class; + protected $model = Note::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class NoteFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/ProjectFactory.php b/database/factories/ProjectFactory.php index f170cb2..ed1704a 100644 --- a/database/factories/ProjectFactory.php +++ b/database/factories/ProjectFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class ProjectFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Project::class; + protected $model = Project::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class ProjectFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/ReleaseFactory.php b/database/factories/ReleaseFactory.php index 011007d..b10d1b7 100644 --- a/database/factories/ReleaseFactory.php +++ b/database/factories/ReleaseFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class ReleaseFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Release::class; + protected $model = Release::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class ReleaseFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/RoadmapFactory.php b/database/factories/RoadmapFactory.php index 6929b3d..15f3e6f 100644 --- a/database/factories/RoadmapFactory.php +++ b/database/factories/RoadmapFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class RoadmapFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Roadmap::class; + protected $model = Roadmap::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class RoadmapFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/SourceFactory.php b/database/factories/SourceFactory.php index 3f1c560..1d876a5 100644 --- a/database/factories/SourceFactory.php +++ b/database/factories/SourceFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class SourceFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Source::class; + protected $model = Source::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class SourceFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/SprintFactory.php b/database/factories/SprintFactory.php index 36cf31f..5fce41f 100644 --- a/database/factories/SprintFactory.php +++ b/database/factories/SprintFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class SprintFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Sprint::class; + protected $model = Sprint::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class SprintFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/TagFactory.php b/database/factories/TagFactory.php index 5e4191f..fe7c8b0 100644 --- a/database/factories/TagFactory.php +++ b/database/factories/TagFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class TagFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Tag::class; + protected $model = Tag::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class TagFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/TeamFactory.php b/database/factories/TeamFactory.php index 4e1a8b6..8624de0 100644 --- a/database/factories/TeamFactory.php +++ b/database/factories/TeamFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class TeamFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Team::class; + protected $model = Team::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class TeamFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/TicketFactory.php b/database/factories/TicketFactory.php index 1b9264e..a846fe5 100644 --- a/database/factories/TicketFactory.php +++ b/database/factories/TicketFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class TicketFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Ticket::class; + protected $model = Ticket::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class TicketFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/factories/VersionFactory.php b/database/factories/VersionFactory.php index 3daa71e..d70e9f6 100644 --- a/database/factories/VersionFactory.php +++ b/database/factories/VersionFactory.php @@ -1,26 +1,26 @@ + * @extends Factory */ class VersionFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var string + * @var class-string */ - protected $model = \GammaMatrix\Playground\Matrix\Models\Version::class; + protected $model = Version::class; /** * Define the model's default state. @@ -29,9 +29,10 @@ class VersionFactory extends Factory */ public function definition(): array { - $title = $this->faker->bs; + $title = $this->faker->sentence(3); + return [ - 'label' => fake()->bs, + 'label' => $this->faker->sentence(3), 'title' => $title, 'slug' => Str::slug($title, '-'), 'description' => $this->faker->sentence(3), diff --git a/database/migrations-laravel/2014_10_12_000000_create_users_table.php b/database/migrations-laravel/2014_10_12_000000_create_users_table.php index 6c2b6d5..1f97419 100644 --- a/database/migrations-laravel/2014_10_12_000000_create_users_table.php +++ b/database/migrations-laravel/2014_10_12_000000_create_users_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations-laravel/2014_10_12_100000_create_password_reset_tokens_table.php b/database/migrations-laravel/2014_10_12_100000_create_password_reset_tokens_table.php index d8336e7..8b5b388 100644 --- a/database/migrations-laravel/2014_10_12_100000_create_password_reset_tokens_table.php +++ b/database/migrations-laravel/2014_10_12_100000_create_password_reset_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations-laravel/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations-laravel/2019_08_19_000000_create_failed_jobs_table.php index 667f82c..3eec77b 100644 --- a/database/migrations-laravel/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations-laravel/2019_08_19_000000_create_failed_jobs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations-laravel/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations-laravel/2019_12_14_000001_create_personal_access_tokens_table.php index 668cd96..0fc7a63 100644 --- a/database/migrations-laravel/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations-laravel/2019_12_14_000001_create_personal_access_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php b/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php index e6c0404..61d50ad 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php @@ -1,6 +1,6 @@ + + + + tests/Unit + + + tests/Feature + + + + + + + + + + + + + + + + + + + + + + src + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9e3743b..b646b2b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ - - - - - - - + + + + + + + - - - - + + + + @@ -57,19 +57,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/src/Models/Backlog.php b/src/Models/Backlog.php index 17b7030..9fb356a 100644 --- a/src/Models/Backlog.php +++ b/src/Models/Backlog.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'created_by_id' => null, 'modified_by_id' => null, @@ -77,6 +81,11 @@ class Backlog extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', @@ -148,6 +157,11 @@ class Backlog extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Board.php b/src/Models/Board.php index 16199e6..f4d24c7 100644 --- a/src/Models/Board.php +++ b/src/Models/Board.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Board extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'board_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Board extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Epic.php b/src/Models/Epic.php index 9f18202..0183456 100644 --- a/src/Models/Epic.php +++ b/src/Models/Epic.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Epic extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'epic_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Epic extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Flow.php b/src/Models/Flow.php index c9d5255..ef568ac 100644 --- a/src/Models/Flow.php +++ b/src/Models/Flow.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -32,6 +36,11 @@ class Flow extends Model 'options' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'flow_type' => 'string', 'gids' => 'integer', @@ -99,6 +108,11 @@ class Flow extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Milestone.php b/src/Models/Milestone.php index cdab77f..3cce3d7 100644 --- a/src/Models/Milestone.php +++ b/src/Models/Milestone.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Milestone extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'milestone_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Milestone extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Note.php b/src/Models/Note.php index 6836f8d..6289c83 100644 --- a/src/Models/Note.php +++ b/src/Models/Note.php @@ -1,20 +1,23 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -33,6 +36,11 @@ class Note extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'note_type' => 'string', 'gids' => 'integer', @@ -104,6 +112,11 @@ class Note extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Project.php b/src/Models/Project.php index 87d856e..dbcc160 100644 --- a/src/Models/Project.php +++ b/src/Models/Project.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Project extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'project_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Project extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Release.php b/src/Models/Release.php index 5fc5922..2aa4144 100644 --- a/src/Models/Release.php +++ b/src/Models/Release.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Release extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'release_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Release extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Roadmap.php b/src/Models/Roadmap.php index b36c2fe..a86e4e3 100644 --- a/src/Models/Roadmap.php +++ b/src/Models/Roadmap.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Roadmap extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'roadmap_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Roadmap extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Source.php b/src/Models/Source.php index 126087c..a6a80c8 100644 --- a/src/Models/Source.php +++ b/src/Models/Source.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Source extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'source_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Source extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Sprint.php b/src/Models/Sprint.php index effea15..c1db5e4 100644 --- a/src/Models/Sprint.php +++ b/src/Models/Sprint.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Sprint extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'sprint_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Sprint extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Tag.php b/src/Models/Tag.php index dd978cb..85bca8f 100644 --- a/src/Models/Tag.php +++ b/src/Models/Tag.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Tag extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'tag_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Tag extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Team.php b/src/Models/Team.php index 7812487..e99c086 100644 --- a/src/Models/Team.php +++ b/src/Models/Team.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Team extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'team_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Team extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/Models/Ticket.php b/src/Models/Ticket.php index 0364d2d..25d01fc 100644 --- a/src/Models/Ticket.php +++ b/src/Models/Ticket.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'created_by_id' => null, 'modified_by_id' => null, @@ -96,6 +100,11 @@ class Ticket extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'created_at' => 'timestamp', 'updated_at' => 'timestamp', @@ -182,6 +191,11 @@ class Ticket extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', @@ -314,8 +328,13 @@ public function board(): HasOne */ public function completedBy(): HasOne { + /** + * @var class-string<\Illuminate\Contracts\Auth\Authenticatable> + */ + $uc = config('playground.user', '\\App\\Models\\User'); + return $this->hasOne( - config('playground.user', '\\App\\Models\\User'), + $uc, 'id', 'completed_by_id' ); @@ -386,8 +405,13 @@ public function release(): HasOne */ public function reportedBy(): HasOne { + /** + * @var class-string<\Illuminate\Contracts\Auth\Authenticatable> + */ + $uc = config('playground.user', '\\App\\Models\\User'); + return $this->hasOne( - config('playground.user', '\\App\\Models\\User'), + $uc, 'id', 'reported_by_id' ); diff --git a/src/Models/Version.php b/src/Models/Version.php index 812ec84..be11584 100644 --- a/src/Models/Version.php +++ b/src/Models/Version.php @@ -1,20 +1,24 @@ + */ protected $attributes = [ 'owned_by_id' => null, 'parent_id' => null, @@ -47,6 +51,11 @@ class Version extends Model 'sources' => '{}', ]; + /** + * The attributes that should be cast. + * + * @var array + */ protected $casts = [ 'version_type' => 'string', 'gids' => 'integer', @@ -118,6 +127,11 @@ class Version extends Model 'sources' => 'array', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'owned_by_id', 'parent_id', diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 84b58a0..a35efb7 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -1,15 +1,14 @@ app->runningInConsole()) { - // Publish configuration - $this->publishes([ - dirname(__DIR__).'/config/playground-matrix.php' - => config_path('playground-matrix.php') - ], 'playground-config'); - - // Publish migrations - $this->publishMigrations(); - - // Load migrations - if (!empty($config['load']) - && !empty($config['load']['migrations']) - ) { - $this->loadMigrationsFrom(dirname(__DIR__). '/database/migrations'); + /** + * @var array $config + */ + $config = config($this->package); + + if (! empty($config['load']) && is_array($config['load'])) { + + if ($this->app->runningInConsole()) { + // Publish configuration + $this->publishes([ + sprintf('%1$s/config/%2$s.php', dirname(__DIR__), $this->package) => config_path(sprintf('%1$s.php', $this->package)), + ], 'playground-config'); + + // Publish migrations + $this->publishMigrations(); + + // Load migrations + if (! empty($config['load']['migrations'])) { + $this->loadMigrationsFrom(dirname(__DIR__).'/database/migrations'); + } } } @@ -50,23 +52,19 @@ public function boot() /** * Register any application services. - * - * @return void */ - public function register() + public function register(): void { $this->mergeConfigFrom( - dirname(__DIR__) . '/config/playground-matrix.php', + dirname(__DIR__).'/config/playground-matrix.php', 'playground-matrix' ); } /** * Register any application services. - * - * @return void */ - public function publishMigrations() + public function publishMigrations(): void { $migrations = []; @@ -93,21 +91,23 @@ public function publishMigrations() $this->publishes($migrations, 'playground-migrations'); } - - public function about() + public function about(): void { $config = config($this->package); + $config = is_array($config) ? $config : []; + + $load = ! empty($config['load']) && is_array($config['load']) ? $config['load'] : []; $version = $this->version(); AboutCommand::add('Playground Matrix', fn () => [ - 'Load Migrations' => !empty($config['load']['migrations']) ? 'ENABLED' : 'DISABLED', + 'Load Migrations' => ! empty($load['migrations']) ? 'ENABLED' : 'DISABLED', 'Package' => $this->package, 'Version' => $version, ]); } - public function version() + public function version(): string { return static::VERSION; } diff --git a/tests/Feature/Backlog/ModelTest.php b/tests/Feature/Backlog/ModelTest.php deleted file mode 100644 index ec74242..0000000 --- a/tests/Feature/Backlog/ModelTest.php +++ /dev/null @@ -1,113 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'note' => [ - 'key' => 'note_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Note::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Board/ModelTest.php b/tests/Feature/Board/ModelTest.php deleted file mode 100644 index 948bc5c..0000000 --- a/tests/Feature/Board/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Epic/ModelTest.php b/tests/Feature/Epic/ModelTest.php deleted file mode 100644 index 46523c0..0000000 --- a/tests/Feature/Epic/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Flow/ModelTest.php b/tests/Feature/Flow/ModelTest.php deleted file mode 100644 index 36d3bdc..0000000 --- a/tests/Feature/Flow/ModelTest.php +++ /dev/null @@ -1,58 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'note' => [ - 'key' => 'note_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Note::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - ]; -} diff --git a/tests/Feature/Milestone/ModelTest.php b/tests/Feature/Milestone/ModelTest.php deleted file mode 100644 index 912229a..0000000 --- a/tests/Feature/Milestone/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Models/Backlog/ModelTest.php b/tests/Feature/Models/Backlog/ModelTest.php new file mode 100644 index 0000000..4aa9755 --- /dev/null +++ b/tests/Feature/Models/Backlog/ModelTest.php @@ -0,0 +1,110 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'note' => [ + 'key' => 'note_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Note::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Board/ModelTest.php b/tests/Feature/Models/Board/ModelTest.php new file mode 100644 index 0000000..2cc26d7 --- /dev/null +++ b/tests/Feature/Models/Board/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Epic/ModelTest.php b/tests/Feature/Models/Epic/ModelTest.php new file mode 100644 index 0000000..dc5f447 --- /dev/null +++ b/tests/Feature/Models/Epic/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Flow/ModelTest.php b/tests/Feature/Models/Flow/ModelTest.php new file mode 100644 index 0000000..6f69ade --- /dev/null +++ b/tests/Feature/Models/Flow/ModelTest.php @@ -0,0 +1,55 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'note' => [ + 'key' => 'note_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Note::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + ]; +} diff --git a/tests/Feature/Models/Milestone/ModelTest.php b/tests/Feature/Models/Milestone/ModelTest.php new file mode 100644 index 0000000..ddc3df3 --- /dev/null +++ b/tests/Feature/Models/Milestone/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/ModelCase.php b/tests/Feature/Models/ModelCase.php similarity index 61% rename from tests/Feature/ModelCase.php rename to tests/Feature/Models/ModelCase.php index a7b7b92..8f75319 100644 --- a/tests/Feature/ModelCase.php +++ b/tests/Feature/Models/ModelCase.php @@ -1,20 +1,16 @@ __METHOD__, // 'path' => dirname(dirname(__DIR__)) . '/database/migrations', // ]); - if (!empty(env('TEST_DB_MIGRATIONS'))) { + if (! empty(env('TEST_DB_MIGRATIONS'))) { // $this->loadLaravelMigrations(); - $this->loadMigrationsFrom(dirname(dirname(__DIR__)) . '/database/migrations-laravel'); - $this->loadMigrationsFrom(dirname(dirname(__DIR__)) . '/database/migrations'); + $this->loadMigrationsFrom(dirname(dirname(__DIR__)).'/database/migrations-laravel'); + $this->loadMigrationsFrom(dirname(dirname(__DIR__)).'/database/migrations'); } } @@ -63,8 +59,8 @@ protected function setUp(): void */ protected function getEnvironmentSetUp($app) { - $app['config']->set('auth.providers.users.model', 'GammaMatrix\\Playground\\Test\\Models\\User'); - $app['config']->set('playground.user', 'GammaMatrix\\Playground\\Test\\Models\\User'); + $app['config']->set('auth.providers.users.model', 'Playground\\Test\\Models\\User'); + $app['config']->set('playground.user', 'Playground\\Test\\Models\\User'); $app['config']->set('playground.auth.verify', 'user'); $app['config']->set('playground-matrix.load.migrations', true); diff --git a/tests/Feature/Models/Note/ModelTest.php b/tests/Feature/Models/Note/ModelTest.php new file mode 100644 index 0000000..0901486 --- /dev/null +++ b/tests/Feature/Models/Note/ModelTest.php @@ -0,0 +1,17 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Release/ModelTest.php b/tests/Feature/Models/Release/ModelTest.php new file mode 100644 index 0000000..41cab80 --- /dev/null +++ b/tests/Feature/Models/Release/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Roadmap/ModelTest.php b/tests/Feature/Models/Roadmap/ModelTest.php new file mode 100644 index 0000000..829dda5 --- /dev/null +++ b/tests/Feature/Models/Roadmap/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Source/ModelTest.php b/tests/Feature/Models/Source/ModelTest.php new file mode 100644 index 0000000..024f9c5 --- /dev/null +++ b/tests/Feature/Models/Source/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Sprint/ModelTest.php b/tests/Feature/Models/Sprint/ModelTest.php new file mode 100644 index 0000000..d7fda36 --- /dev/null +++ b/tests/Feature/Models/Sprint/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Tag/ModelTest.php b/tests/Feature/Models/Tag/ModelTest.php new file mode 100644 index 0000000..c111372 --- /dev/null +++ b/tests/Feature/Models/Tag/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Team/ModelTest.php b/tests/Feature/Models/Team/ModelTest.php new file mode 100644 index 0000000..e126eba --- /dev/null +++ b/tests/Feature/Models/Team/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Ticket/ModelTest.php b/tests/Feature/Models/Ticket/ModelTest.php new file mode 100644 index 0000000..48207a8 --- /dev/null +++ b/tests/Feature/Models/Ticket/ModelTest.php @@ -0,0 +1,115 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'completedBy' => [ + 'key' => 'completed_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'reportedBy' => [ + 'key' => 'reported_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'version' => [ + 'key' => 'version_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + ]; +} diff --git a/tests/Feature/Models/Version/ModelTest.php b/tests/Feature/Models/Version/ModelTest.php new file mode 100644 index 0000000..b95252c --- /dev/null +++ b/tests/Feature/Models/Version/ModelTest.php @@ -0,0 +1,105 @@ + [ + 'key' => 'created_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'modifier' => [ + 'key' => 'modified_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'owner' => [ + 'key' => 'owned_by_id', + 'rule' => 'create', + 'modelClass' => \Playground\Test\Models\User::class, + ], + 'parent' => [ + 'key' => 'parent_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Version::class, + ], + 'backlog' => [ + 'key' => 'backlog_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Backlog::class, + ], + 'board' => [ + 'key' => 'board_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Board::class, + ], + 'epic' => [ + 'key' => 'epic_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Epic::class, + ], + 'flow' => [ + 'key' => 'flow_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Flow::class, + ], + 'milestone' => [ + 'key' => 'milestone_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Milestone::class, + ], + 'project' => [ + 'key' => 'project_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Project::class, + ], + 'release' => [ + 'key' => 'release_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Release::class, + ], + 'roadmap' => [ + 'key' => 'roadmap_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Roadmap::class, + ], + 'source' => [ + 'key' => 'source_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Source::class, + ], + 'sprint' => [ + 'key' => 'sprint_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Sprint::class, + ], + 'tag' => [ + 'key' => 'tag_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Tag::class, + ], + 'team' => [ + 'key' => 'team_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Team::class, + ], + 'ticket' => [ + 'key' => 'ticket_id', + 'rule' => 'create', + 'modelClass' => \Playground\Matrix\Models\Ticket::class, + ], + ]; +} diff --git a/tests/Feature/Note/ModelTest.php b/tests/Feature/Note/ModelTest.php deleted file mode 100644 index a8f210e..0000000 --- a/tests/Feature/Note/ModelTest.php +++ /dev/null @@ -1,20 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Release/ModelTest.php b/tests/Feature/Release/ModelTest.php deleted file mode 100644 index a6cae39..0000000 --- a/tests/Feature/Release/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Roadmap/ModelTest.php b/tests/Feature/Roadmap/ModelTest.php deleted file mode 100644 index 55fd3ce..0000000 --- a/tests/Feature/Roadmap/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Source/ModelTest.php b/tests/Feature/Source/ModelTest.php deleted file mode 100644 index bd073a1..0000000 --- a/tests/Feature/Source/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Sprint/ModelTest.php b/tests/Feature/Sprint/ModelTest.php deleted file mode 100644 index d265a55..0000000 --- a/tests/Feature/Sprint/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Tag/ModelTest.php b/tests/Feature/Tag/ModelTest.php deleted file mode 100644 index c6923ba..0000000 --- a/tests/Feature/Tag/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Team/ModelTest.php b/tests/Feature/Team/ModelTest.php deleted file mode 100644 index cac8726..0000000 --- a/tests/Feature/Team/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Ticket/ModelTest.php b/tests/Feature/Ticket/ModelTest.php deleted file mode 100644 index d42a82a..0000000 --- a/tests/Feature/Ticket/ModelTest.php +++ /dev/null @@ -1,118 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'completedBy' => [ - 'key' => 'completed_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'reportedBy' => [ - 'key' => 'reported_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'version' => [ - 'key' => 'version_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - ]; -} diff --git a/tests/Feature/Version/ModelTest.php b/tests/Feature/Version/ModelTest.php deleted file mode 100644 index 61d16e1..0000000 --- a/tests/Feature/Version/ModelTest.php +++ /dev/null @@ -1,108 +0,0 @@ - [ - 'key' => 'created_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'modifier' => [ - 'key' => 'modified_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'owner' => [ - 'key' => 'owned_by_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Test\Models\User::class, - ], - 'parent' => [ - 'key' => 'parent_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Version::class, - ], - 'backlog' => [ - 'key' => 'backlog_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Backlog::class, - ], - 'board' => [ - 'key' => 'board_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Board::class, - ], - 'epic' => [ - 'key' => 'epic_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Epic::class, - ], - 'flow' => [ - 'key' => 'flow_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Flow::class, - ], - 'milestone' => [ - 'key' => 'milestone_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Milestone::class, - ], - 'project' => [ - 'key' => 'project_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Project::class, - ], - 'release' => [ - 'key' => 'release_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Release::class, - ], - 'roadmap' => [ - 'key' => 'roadmap_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Roadmap::class, - ], - 'source' => [ - 'key' => 'source_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Source::class, - ], - 'sprint' => [ - 'key' => 'sprint_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Sprint::class, - ], - 'tag' => [ - 'key' => 'tag_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Tag::class, - ], - 'team' => [ - 'key' => 'team_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Team::class, - ], - 'ticket' => [ - 'key' => 'ticket_id', - 'rule' => 'create', - 'modelClass' => \GammaMatrix\Playground\Matrix\Models\Ticket::class, - ], - ]; -} diff --git a/tests/Unit/Flow/ModelTest.php b/tests/Unit/Flow/ModelTest.php deleted file mode 100644 index 659c749..0000000 --- a/tests/Unit/Flow/ModelTest.php +++ /dev/null @@ -1,30 +0,0 @@ -set('auth.providers.users.model', 'GammaMatrix\\Playground\\Test\\Models\\User'); - $app['config']->set('playground.user', 'GammaMatrix\\Playground\\Test\\Models\\User'); + $app['config']->set('auth.providers.users.model', 'Playground\\Test\\Models\\User'); + $app['config']->set('playground.user', 'Playground\\Test\\Models\\User'); $app['config']->set('playground.auth.verify', 'user'); $app['config']->set('playground-matrix.load.migrations', true); diff --git a/tests/Unit/Models/Note/ModelTest.php b/tests/Unit/Models/Note/ModelTest.php new file mode 100644 index 0000000..d9e1101 --- /dev/null +++ b/tests/Unit/Models/Note/ModelTest.php @@ -0,0 +1,17 @@ +