Restructure src/ and tests/ from package-by-type to package-by-domain
All checks were successful
CI / Coding Standards (push) Successful in 43s
CI / PHPStan (push) Successful in 52s
CI / Tests (PHP 8.1) (push) Successful in 47s
CI / Tests (PHP 8.2) (push) Successful in 49s
CI / Tests (PHP 8.3) (push) Successful in 37s
CI / No Debug Code (push) Successful in 2s

All classes are now organised by domain (Availability, Booking, Auth).
Each domain package contains its value object, repository, admin controller,
REST endpoint, and any shortcode pages under a matching sub-namespace.
Cross-cutting wiring (Plugin, AdminMenu, RestRegistrar, ShortcodeRegistrar,
Schema) lives at src/ root. Tests mirror the domain structure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 16:37:30 -03:00
parent ed49924f95
commit 2fb2ca392d
26 changed files with 108 additions and 83 deletions

View File

@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Tests\Unit\Roles;
namespace Unsupervised\Schedular\Tests\Unit\Auth;
use Brain\Monkey\Functions;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
use Unsupervised\Schedular\Tests\Unit\TestCase;
class RoleManagerTest extends TestCase

View File

@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Tests\Unit\Data;
namespace Unsupervised\Schedular\Tests\Unit\Availability;
use Brain\Monkey\Functions;
use Mockery;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Model\AvailabilitySlot;
use Unsupervised\Schedular\Availability\AvailabilityRepository;
use Unsupervised\Schedular\Availability\AvailabilitySlot;
use Unsupervised\Schedular\Tests\Unit\TestCase;
class AvailabilityRepositoryTest extends TestCase
@@ -18,9 +18,9 @@ class AvailabilityRepositoryTest extends TestCase
{
parent::setUp();
$this->db = Mockery::mock(\wpdb::class);
$this->db = Mockery::mock(\wpdb::class);
$this->db->prefix = 'wp_';
$this->repo = new AvailabilityRepository($this->db);
$this->repo = new AvailabilityRepository($this->db);
}
public function testInsertCallsWpdbInsertAndReturnsId(): void

View File

@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Tests\Unit\Model;
namespace Unsupervised\Schedular\Tests\Unit\Availability;
use Unsupervised\Schedular\Model\AvailabilitySlot;
use Unsupervised\Schedular\Availability\AvailabilitySlot;
use Unsupervised\Schedular\Tests\Unit\TestCase;
class AvailabilitySlotTest extends TestCase

View File

@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Tests\Unit\Data;
namespace Unsupervised\Schedular\Tests\Unit\Booking;
use Brain\Monkey\Functions;
use Mockery;
use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Model\Lesson;
use Unsupervised\Schedular\Booking\BookingRepository;
use Unsupervised\Schedular\Booking\Lesson;
use Unsupervised\Schedular\Tests\Unit\TestCase;
class BookingRepositoryTest extends TestCase

View File

@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Tests\Unit\Model;
namespace Unsupervised\Schedular\Tests\Unit\Booking;
use Unsupervised\Schedular\Model\Lesson;
use Unsupervised\Schedular\Booking\Lesson;
use Unsupervised\Schedular\Tests\Unit\TestCase;
class LessonTest extends TestCase