Skip to content

Commit 95e33fb

Browse files
Fix styling
1 parent 8caa25f commit 95e33fb

7 files changed

Lines changed: 26 additions & 31 deletions

File tree

packages/item/database/factories/ItemFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
namespace Moox\Item\Database\Factories;
44

@@ -17,4 +17,4 @@ public function definition()
1717
'custom_properties' => [],
1818
];
1919
}
20-
}
20+
}

packages/item/src/Models/Item.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
namespace Moox\Item\Models;
66

77
use Illuminate\Database\Eloquent\Factories\HasFactory;
8-
use Moox\Item\Database\Factories\ItemFactory;
98
use Moox\Core\Entities\Items\Item\BaseItemModel;
9+
use Moox\Item\Database\Factories\ItemFactory;
1010

1111
class Item extends BaseItemModel
1212
{
1313
use HasFactory;
14+
1415
protected $fillable = [
1516
'title',
1617
'description',
@@ -27,8 +28,8 @@ public static function getResourceName(): string
2728
return 'item';
2829
}
2930

30-
public static function newFactory()
31-
{
32-
return ItemFactory::new();
33-
}
31+
public static function newFactory()
32+
{
33+
return ItemFactory::new();
34+
}
3435
}

packages/item/src/Moox/Plugins/ItemPlugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
declare(strict_types=1);
44

5-
65
namespace Moox\Item\Moox\Plugins;
76

87
use Filament\Contracts\Plugin;

packages/item/tests/Pest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
} else {
77
uses(Moox\Item\Tests\TestCase::class)->in('Feature', 'Unit');
88
}
9-

packages/item/tests/TestCase.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
namespace Moox\Item\Tests;
44

5+
use Illuminate\Foundation\Testing\RefreshDatabase;
56
use Moox\Item\ItemServiceProvider;
6-
use Orchestra\Testbench\TestCase as Orchestra;
77
use Orchestra\Testbench\Attributes\WithMigration;
8-
use Illuminate\Foundation\Testing\RefreshDatabase;
9-
use Illuminate\Database\Eloquent\Factories\Factory;
10-
8+
use Orchestra\Testbench\TestCase as Orchestra;
119

12-
#[WithMigration('laravel', 'cache', 'queue')]
10+
#[WithMigration('laravel', 'cache', 'queue')]
1311
#[WithMigration('session')]
1412
class TestCase extends Orchestra
1513
{
1614
use RefreshDatabase;
15+
1716
protected function setUp(): void
1817
{
1918
parent::setUp();
20-
2119
}
2220

2321
protected function getPackageProviders($app)
@@ -27,13 +25,11 @@ protected function getPackageProviders($app)
2725
];
2826
}
2927

30-
31-
3228
protected function setUpTestUser(): array
3329
{
3430
// Create users table (included in Laravel migrations via WithMigration attribute)
3531
// Orchestra Testbench automatically creates users table with #[WithMigration('laravel')]
36-
32+
3733
return [
3834
'name' => 'Test User',
3935
'email' => 'test@example.com',
@@ -44,15 +40,18 @@ protected function setUpTestUser(): array
4440
protected function createTestUser(): object
4541
{
4642
$userData = $this->setUpTestUser();
47-
43+
4844
// Use Laravel's built-in User model for testing
4945
$userClass = config('item.auth.user', 'Testbench\\Models\\User');
50-
51-
if (!class_exists($userClass)) {
46+
47+
if (! class_exists($userClass)) {
5248
// Fallback to a simple test user
53-
$userClass = new class extends \Illuminate\Foundation\Auth\User {
49+
$userClass = new class extends \Illuminate\Foundation\Auth\User
50+
{
5451
protected $table = 'users';
52+
5553
protected $fillable = ['name', 'email', 'password'];
54+
5655
protected $hidden = ['password'];
5756
};
5857
}

packages/item/tests/Unit/ItemTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
use Moox\Item\Models\Item;
44

@@ -18,5 +18,3 @@
1818
$item = Item::factory()->create();
1919
expect($item)->toBeInstanceOf(Item::class);
2020
});
21-
22-

packages/item/tests/Unit/TestcaseTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
$testClass = get_class($this);
66
$parentClass = get_parent_class($this);
77

8-
dump();
8+
dump();
99
dump('=== TESTCASE USAGE ===');
1010
if ($this instanceof Tests\TestCase) {
1111
dump('✅ Using Root Laravel TestCase');
12-
dump('TestCase file: ' . (new ReflectionClass('Tests\\TestCase'))->getFileName());
12+
dump('TestCase file: '.(new ReflectionClass('Tests\\TestCase'))->getFileName());
1313
} elseif ($this instanceof Moox\Item\Tests\TestCase) {
1414
dump('📦 Using Package TestCase (Testbench)');
15-
dump('TestCase file: ' . (new ReflectionClass('Moox\\Item\\Tests\\TestCase'))->getFileName());
15+
dump('TestCase file: '.(new ReflectionClass('Moox\\Item\\Tests\\TestCase'))->getFileName());
1616
} else {
1717
dump('❌ Using fallback PHPUnit TestCase');
1818
}
19-
20-
19+
2120
expect(true)->toBeTrue();
22-
});
21+
});

0 commit comments

Comments
 (0)