#!/usr/bin/env php === Running All Unit Tests === Running: test-collection-controller-final.php ✓ PASSED Running: test-collection-controller-refactoring.php ✗ FAILED Error output: === CollectionController Refactoring Tests === Test 1: Constructor dependencies... PHP Fatal error: Uncaught TypeError: MemorizeLive\App\Routes\Controllers\CollectionController::__construct(): Argument #2 ($config) must be of type MemorizeLive\App\Logic\Helpers\ConfigManager, array given, called in /home/memorize/public_html/Tests/Unit/Controllers/test-collection-controller-refactoring.php on line 107 and defined in /home/memorize/public_html/App/Routes/Controllers/CollectionController.php:15 Stack trace: #0 /home/memorize/public_html/Tests/Unit/Controllers/test-collection-controller-refactoring.php(107): MemorizeLive\App\Routes\Controllers\CollectionController->__construct() #1 /home/memorize/public_html/Tests/Unit/Controllers/test-collection-controller-refactoring.php(351): testConstructorDependencies() #2 {main} thrown in /home/memorize/public_html/App/Routes/Controllers/CollectionController.php on line 15 Running: test-collection-refactoring-detailed.php ✓ PASSED Running: test-collection-refactoring-simple.php ✓ PASSED Running: test-notifications-controller-refactoring.php ✗ FAILED Error output: === NotificationsController Refactoring Test Suite === ✗ Constructor should have 'private array $config' parameter ✓ Constructor should NOT have CsrfService dependency ✓ Should NOT import CsrfService ✗ list() should use $this->config['pagination']['per_page'] for pagination ✓ list() should NOT have hardcoded perPage = 20 ✓ list() should call getActiveNotificationsByUserWithPagination for non-admin users ✗ list() should call getAllNotificationsWithPagination for admin users ✗ Controller methods should use $request['identity']->role for admin check ... (truncated) Running: test-schedules-controller-refactoring.php ✗ FAILED Error output: === SchedulesController Refactoring Test Suite === ✗ Constructor should have 'private array $config' parameter ✓ Constructor should NOT have CsrfService dependency ✓ Should NOT import CsrfService ✗ list() should use $this->config['pagination']['per_page'] for pagination ✓ list() should NOT have hardcoded perPage = 20 ✓ list() should call getActiveSchedulesByUserWithPagination for non-admin users ✓ list() should call getAllSchedulesWithPagination for admin users ✗ view() should use $request['identity']->role for admin check ... (truncated) Running: test-studies-controller-refactoring.php ✗ FAILED Error output: StudiesController Refactoring Tests ================================== PHP Warning: file_get_contents(/home/memorize/public_html/Tests/Unit/Controllers/../../../Data/config.json): Failed to open stream: No such file or directory in /home/memorize/public_html/Tests/Unit/Controllers/test-studies-controller-refactoring.php on line 57 PHP Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, bool given in /home/memorize/public_html/Tests/Unit/Controllers/test-studies-controller-refactoring.php:57 Stack trace: #0 /home/memorize/public_html/Tests/Unit/Controllers/test-studies-controller-refactoring.php(57): json_decode() #1 {main} thrown in /home/memorize/public_html/Tests/Unit/Controllers/test-studies-controller-refactoring.php on line 57 Running: test-verseapi-controller.php ✓ PASSED Running: test-config-manager-get-hierarchical-defaults-autopersist.php ✗ FAILED Error output: ======================================== ConfigManager get() Method Tests ======================================== Running: AC1: Colon-separated hierarchical keys... PHP Warning: file_get_contents(/home/memorize/public_html/Tests/Unit/Helpers/../../../Data/config.json): Failed to open stream: No such file or directory in /home/memorize/public_html/Tests/Unit/Helpers/test-config-manager-get-hierarchical-defaults-autopersist.php on line 38 ❌ FAILED Error: json_decode(): Argument #1 ($json) must be of type string, bool given File: /home/memorize/public_html/Tests/Unit/Helpers/test-config-manager-get-hierarchical-defaults-autopersist.php:38 PHP Fatal error: Uncaught Error: Typed property MemorizeLive\App\Tests\ConfigManagerGetHierarchicalDefaultsAutopersistTest::$originalConfig must not be accessed before initialization in /home/memorize/public_html/Tests/Unit/Helpers/test-config-manager-get-hierarchical-defaults-autopersist.php:47 ... (truncated) Running: test-content-negotiation.php ✓ PASSED Running: test-friendly-next-delivery-time-core.php ✓ PASSED Running: test-friendly-next-delivery-time.php ✗ FAILED Error output: Testing friendlyNextDeliveryTime function ===================================== Mock current time: 2026-01-06 05:00:00 UTC ✓ Test 1 PASSED: timestamp=NULL, timezone=UTC => 'scheduled' ✓ Test 2 PASSED: timestamp=, timezone=UTC => 'scheduled' ✓ Test 3 PASSED: timestamp=0, timezone=UTC => 'scheduled' ✗ Test 4 FAILED: timestamp=2026-01-27 08:00:00, timezone=UTC Expected: 'this morning' ... (truncated) Running: test-friendly-next-session.php ✓ PASSED Running: test-html-response-null-template-guard.php ✗ FAILED Error output: HTML Response Null Template Guard Tests ========================================= ✓ htmlResponse() accepts nullable template parameter ✓ htmlResponse() checks template before rendering ✓ htmlResponse() falls back to error-fallback template ✓ Debug logging removed from htmlResponse() ✓ Fallback provides error message ✓ Fallback provides error details ✓ error-fallback.php template exists ... (truncated) Running: test-pagination-helper.php ✗ FAILED Error output: === PaginationHelper Tests === Test 1: Basic pagination with defaults... ✓ Basic pagination works with defaults Test 2: Custom page from request... ✓ Custom page works correctly Test 3: Last page navigation... ✓ Last page navigation works correctly ... (truncated) Running: test-presenter-wrapping.php ✓ PASSED Running: test-result-pattern.php ✓ PASSED Running: test-skeleton.php ✗ FAILED Error output: ======================================== ML2 Skeleton Test ======================================== Test 1: Router class... ✓ Router works Test 2: App autoloader... ✓ App instantiated ✓ UserService loaded ... (truncated) Running: test-time-helper-completion.php ✓ PASSED Running: test-input-validation.php ✗ FAILED Error output: InputValidation Tests ===================== PHP Warning: file_get_contents(/home/memorize/public_html/Tests/Unit/Middleware/../../../Data/config.json): Failed to open stream: No such file or directory in /home/memorize/public_html/Tests/Unit/Middleware/test-input-validation.php on line 41 PHP Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, bool given in /home/memorize/public_html/Tests/Unit/Middleware/test-input-validation.php:41 Stack trace: #0 /home/memorize/public_html/Tests/Unit/Middleware/test-input-validation.php(41): json_decode() #1 {main} thrown in /home/memorize/public_html/Tests/Unit/Middleware/test-input-validation.php on line 41 Running: test-middleware-architecture.php ✗ FAILED Error output: === Middleware Architecture Test === Test 1: Middleware File Structure ✅ PASS: App/Logic/Middleware/MiddlewareInterface.php loaded successfully ✅ PASS: App/Logic/Middleware/MiddlewareStack.php loaded successfully ✅ PASS: App/Logic/Middleware/IdentityMiddleware.php loaded successfully ✅ PASS: App/Logic/Middleware/AccessMiddleware.php loaded successfully ✅ PASS: App/Logic/Middleware/InputValidation.php loaded successfully ✅ PASS: App/Logic/Middleware/UserContext.php loaded successfully ... (truncated) Running: test-edge-cases.php ✓ PASSED Running: test-notification-subject-builder.php ✓ PASSED Running: test-collection-repository-full.php ✗ FAILED Error output: === CollectionRepository Full Coverage Testing === Setup: Ensure test users exist === Test 1: Find Operations === 1.1 findById() returns null for non-existent ID ✓ findById() returns null for non-existent collection ID 1.2 findByOwner() returns empty array for non-existent user ... (truncated) Running: test-db-connection.php ✗ FAILED Error output: === Testing Database Connection and UserRepository === 1. Loading database configuration... === TEST FAILED === Error: Config file not found: /home/memorize/public_html/Tests/Unit/../../Data/config.json File: /home/memorize/public_html/Tests/Unit/Repositories/test-db-connection.php:29 Running: test-notification-repository-full.php ✗ FAILED Error output: === NotificationRepository Complete Testing === Setup: Ensure test users exist === Test 1: Find Operations === 1.1 find() returns null for non-existent ID ✓ find() returns null for non-existent notification ID 1.2 findByScheduleId() returns null for non-existent schedule ... (truncated) Running: test-repository-error-handling.php ✗ FAILED Error output: === Repository Error Handling Testing === Setup: Ensure test users exist === Test 1: Transaction Rollback on Constraint Violations === 1.1 Foreign key violation triggers rollback for studies ✓ PDOException caught, transaction rolled back: SQLSTATE[23000]: Integrity constraint violation: 1 1.2 NOT NULL constraint violation for studies ... (truncated) Running: test-schedule-repository-full.php ✗ FAILED Error output: === ScheduleRepository Comprehensive Testing === === Test 1: CRUD Operations === PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 table schedules has no column named repeat_count in /home/memorize/public_html/App/Data/Repositories/ScheduleRepository.php:243 Stack trace: #0 /home/memorize/public_html/App/Data/Repositories/ScheduleRepository.php(243): PDO->prepare() #1 /home/memorize/public_html/Tests/Unit/Repositories/test-schedule-repository-full.php(62): MemorizeLive\App\Data\Repositories\ScheduleRepository->create() #2 {main} thrown in /home/memorize/public_html/App/Data/Repositories/ScheduleRepository.php on line 243 Running: test-user-repository.php ✓ PASSED Running: test-authservice-email-verification.php ✓ PASSED Running: test-auto-schedule-api-error-handling.php ✓ PASSED Running: test-auto-schedule-creation.php ✓ PASSED Running: test-collection-service-rules.php ✗ FAILED Error output: === CollectionService Business Rules Testing (Result Pattern) === === Test 1: Collection Creation === ✓ Create collection with valid data returns Result ✓ Create collection with valid data succeeds ✓ Create collection with null description returns Result ✓ Create collection with null description succeeds ✓ Empty name returns Result ... (truncated) Running: test-cron-refactoring.php ✗ FAILED Error output: Cron Refactoring Tests ====================== ✓ Cron.php exists ✓ Cron class exists ✓ Cron has run() ✗ Cron has processNotifications() ✗ Cron has processSchedules() ✗ Cron has processStudies() ✓ run() is public ... (truncated) Running: test-email-service-standalone.php ✓ PASSED Running: test-email-service.php ✗ FAILED Error output: PHP Warning: require_once(/home/engine/project/App/App.php): Failed to open stream: No such file or directory in /home/memorize/public_html/Tests/Unit/Services/test-email-service.php on line 4 PHP Fatal error: Uncaught Error: Failed opening required '/home/engine/project/App/App.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/memorize/public_html/Tests/Unit/Services/test-email-service.php:4 Stack trace: #0 {main} thrown in /home/memorize/public_html/Tests/Unit/Services/test-email-service.php on line 4 Running: test-identity-immutability.php ✗ FAILED Error output: PHP Parse error: syntax error, unexpected token "class" in /home/memorize/public_html/App/Logic/Helpers/Identity.php on line 14 Running: test-responsebuilder-static.php ✓ PASSED Running: test-routing-system.php ✓ PASSED Running: test-schedule-notification-services.php ✓ PASSED Running: test-schedule-service-logic.php ✗ FAILED Error output: === ScheduleService Logic Testing === Setup: Ensure test users exist === Test 1: Schedule Retrieval === 1.1 getSchedule() returns null for non-existent ID ✓ Non-existent schedule returns null 1.2 getScheduleForStudy() returns null for non-existent study ... (truncated) Running: test-service-structure.php ✓ PASSED Running: test-simplify-renderpage.php ✗ FAILED Error output: Test 1: Checking if old files are deleted... PASS: All old files deleted Test 2: Checking if new partial classes exist... PASS: All new partial classes exist Test 3: Checking if partial classes work... PASS: HeaderPartial rendered successfully PASS: MenuPartial class has render method PASS: FooterPartial rendered successfully ... (truncated) Running: test-timezone-service.php ✓ PASSED Running: test-user-password-management.php ✓ PASSED Running: test-verse-body-fix.php ✓ PASSED === Summary === Passed: 24 Failed: 22 Total: 46 ✗ Some Unit tests failed!