Skip to content

Commit

Permalink
Merge pull request #10 from TappNetwork/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
scottgrayson authored Feb 4, 2025
2 parents 86023b0 + 201684c commit d24f2d1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
php: [8.4, 8.3]
laravel: [11.*]
stability: [prefer-lowest, prefer-stable]
Expand Down Expand Up @@ -44,6 +44,8 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.os == 'windows-latest' && '^^^' || '' }}${{ matrix.carbon }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
Expand Down
6 changes: 2 additions & 4 deletions database/factories/DocumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
use Illuminate\Database\Eloquent\Factories\Factory;
use Tapp\FilamentLms\Models\Document;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Document>
*/
class DocumentFactory extends Factory
{
protected $model = Document::class;
Expand All @@ -29,7 +26,8 @@ public function definition(): array
*/
public function configure(): static
{
return $this->afterCreating(function (Document $document) {
return $this->afterCreating(function ($document) {
/** @var Document $document */
$testFile = './vendor/tapp/filament-lms/test.pdf';
$document->addMedia($testFile)
->preservingOriginal()
Expand Down
3 changes: 0 additions & 3 deletions database/factories/LinkFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
use Illuminate\Database\Eloquent\Factories\Factory;
use Tapp\FilamentLms\Models\Link;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Link>
*/
class LinkFactory extends Factory
{
protected $model = Link::class;
Expand Down
30 changes: 15 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ parameters:
count: 1
path: src/LmsPanelProvider.php

-
message: "#^Parameter \\#1 \\$components of method Filament\\\\Panel\\:\\:livewireComponents\\(\\) expects array\\<string, class\\-string\\<Livewire\\\\Component\\>\\>, array\\{'Tapp\\\\\\\\FilamentLms\\\\\\\\Livewire\\\\\\\\VideoStep', 'Tapp\\\\\\\\FilamentLms\\\\\\\\Livewire\\\\\\\\FormStep'\\} given\\.$#"
count: 1
path: src/LmsPanelProvider.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Course\\:\\:\\$image\\.$#"
count: 1
Expand Down Expand Up @@ -111,33 +106,33 @@ parameters:
path: src/Models/Lesson.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Lesson\\:\\:\\$order\\.$#"
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Course\\:\\:\\$slug\\.$#"
count: 1
path: src/Models/Step.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Step\\:\\:\\$order\\.$#"
count: 3
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Lesson\\:\\:\\$order\\.$#"
count: 1
path: src/Models/Step.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Step\\:\\:\\$slug\\.$#"
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Lesson\\:\\:\\$slug\\.$#"
count: 1
path: src/Models/Step.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\StepUser\\:\\:\\$completed_at\\.$#"
count: 2
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Step\\:\\:\\$order\\.$#"
count: 3
path: src/Models/Step.php

-
message: "#^Access to property \\$id on an unknown class Tapp\\\\FilamentLms\\\\Models\\\\User\\.$#"
count: 3
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Step\\:\\:\\$slug\\.$#"
count: 1
path: src/Models/Step.php

-
message: "#^Parameter \\$user of method Tapp\\\\FilamentLms\\\\Models\\\\Step\\:\\:complete\\(\\) has invalid type Tapp\\\\FilamentLms\\\\Models\\\\User\\.$#"
count: 1
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\StepUser\\:\\:\\$completed_at\\.$#"
count: 2
path: src/Models/Step.php

-
Expand All @@ -150,6 +145,11 @@ parameters:
count: 1
path: src/Models/StepUser.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Video\\:\\:\\$url\\.$#"
count: 1
path: src/Models/Video.php

-
message: "#^Access to an undefined property Tapp\\\\FilamentLms\\\\Models\\\\Course\\:\\:\\$slug\\.$#"
count: 2
Expand Down
1 change: 1 addition & 0 deletions src/Models/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
Expand Down
1 change: 1 addition & 0 deletions src/Models/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Tapp\FilamentLms\Database\Factories\LinkFactory;

Expand Down

0 comments on commit d24f2d1

Please sign in to comment.