Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 18, 2024
2 parents 1c7f211 + fd7a21e commit d5231c3
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 4 deletions.
20 changes: 16 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,34 @@
"autoload-dev": {
"psr-4": {
"Orchestra\\Testbench\\BrowserKit\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/"
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"require": {
"php": "^8.2",
"laravel/browser-kit-testing": "dev-develop",
"laravel/browser-kit-testing": "^7.0",
"orchestra/testbench": "^9.0",
"symfony/dom-crawler": "^7.0"
},
"require-dev": {
"laravel/pint": "^1.6",
"phpstan/phpstan": "^1.10.7"
"phpstan/phpstan": "^1.10.50"
},
"scripts": {
"post-autoload-dump": "@prepare",
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve"
],
"lint": [
"@php vendor/bin/phpstan analyse",
"@php vendor/bin/pint"
Expand Down
7 changes: 7 additions & 0 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ abstract class TestCase extends PHPUnit implements Contracts\TestCase
*/
protected $baseUrl = 'http://localhost';

/**
* The latest test response (if any).
*
* @var \Illuminate\Testing\TestResponse|null
*/
public static $latestResponse;

/**
* Setup the test environment.
*
Expand Down
21 changes: 21 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
providers:
- Workbench\App\Providers\WorkbenchServiceProvider

migrations:
- workbench/database/migrations

seeders:
- Workbench\Database\Seeders\DatabaseSeeder

workbench:
start: '/'
install: true
discovers:
web: true
api: false
commands: false
components: false
views: false
build: []
assets: []
sync: []
24 changes: 24 additions & 0 deletions workbench/app/Providers/WorkbenchServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Workbench\App\Providers;

use Illuminate\Support\ServiceProvider;

class WorkbenchServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}

/**
* Bootstrap services.
*/
public function boot(): void
{
//
}
}
Empty file.
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions workbench/database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Workbench\Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}
19 changes: 19 additions & 0 deletions workbench/routes/api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

// Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
// return $request->user();
// });
19 changes: 19 additions & 0 deletions workbench/routes/console.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;

/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/

// Artisan::command('inspire', function () {
// $this->comment(Inspiring::quote());
// })->purpose('Display an inspiring quote');
18 changes: 18 additions & 0 deletions workbench/routes/web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
return view('welcome');
});

0 comments on commit d5231c3

Please sign in to comment.