Skip to content

Commit

Permalink
Merge pull request #2 from t73biz/livewire-integration
Browse files Browse the repository at this point in the history
Initial Livewire setup
  • Loading branch information
t73biz authored Mar 22, 2024
2 parents f67f907 + 96e4024 commit 667fba6
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
],
"require": {
"php": "^8.2",
"spatie/laravel-package-tools": "^1.16",
"illuminate/contracts": "^10.0||^11.0"
"illuminate/contracts": "^10.0||^11.0",
"livewire/livewire": "^3.4",
"spatie/laravel-package-tools": "^1.16"
},
"require-dev": {
"larastan/larastan": "^2.9",
"laravel/pint": "^1.14",
"nunomaduro/collision": "^8.1.1||^7.10.0",
"larastan/larastan": "^2.9",
"orchestra/testbench": "^9.0.0||^8.22.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-arch": "^2.7",
Expand All @@ -35,8 +36,7 @@
},
"autoload": {
"psr-4": {
"T73biz\\LwBits\\": "src/",
"T73biz\\LwBits\\Database\\Factories\\": "database/factories/"
"T73biz\\LwBits\\": "src/"
}
},
"autoload-dev": {
Expand Down
41 changes: 0 additions & 41 deletions database/factories/UserFactory.php

This file was deleted.

21 changes: 0 additions & 21 deletions database/migrations/create_users_table.php

This file was deleted.

1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
paths:
- src
- config
- database
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@
<directory suffix=".php">./src</directory>
</include>
</source>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
</php>
</phpunit>
3 changes: 3 additions & 0 deletions resources/views/containers/div.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
{{-- Foo tbol --}}
</div>
13 changes: 13 additions & 0 deletions src/Components/Containers/Div.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace T73biz\LwBits\Components\Containers;

use Livewire\Component;

class Div extends Component
{
public function render()
{
return view('lw-bits::containers.div');
}
}
7 changes: 0 additions & 7 deletions src/LwBits.php

This file was deleted.

46 changes: 0 additions & 46 deletions src/Models/User.php

This file was deleted.

5 changes: 0 additions & 5 deletions tests/ArchTest.php

This file was deleted.

9 changes: 9 additions & 0 deletions tests/Feature/Containers/DivTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use Livewire\Livewire;
use T73biz\LwBits\Components\Containers\Div;

it('can render', function () {
Livewire::test(Div::class)
->assertStatus(200);
});
19 changes: 2 additions & 17 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,17 @@

namespace T73biz\LwBits\Tests;

use Illuminate\Database\Eloquent\Factories\Factory;
use Livewire\LivewireServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
use T73biz\LwBits\LwBitsServiceProvider;

class TestCase extends Orchestra
{
protected function setUp(): void
{
parent::setUp();

Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'T73biz\\LwBits\\Database\\Factories\\'.class_basename($modelName).'Factory'
);
}

protected function getPackageProviders($app): array
{
return [
LwBitsServiceProvider::class,
LivewireServiceProvider::class,
];
}

public function getEnvironmentSetUp($app): void
{
config()->set('database.default', 'testing');
$migration = include __DIR__.'/../database/migrations/create_users_table.php';
$migration->up();
}
}

0 comments on commit 667fba6

Please sign in to comment.