foundation-test.php
Source file: tests/backend/foundation-test.php
Module: tests-backend
Size: 130 lines
SHA-256: 33f05d3c88ae94e5b4f77cf005bf2857e16f1211a9103a431c4036a7c7dda13b
Responsibility
Checks PHP backend assumptions; database doubles are not live MariaDB evidence.
Declared entry points
verify— source line 8.rejects— source line 13.implements— source line 47.all— source line 48.WP_REST_Controller— source line 53.WP_REST_Server— source line 54.WP_REST_Response— source line 55.__construct— source line 57.header— source line 58.WP_Error— source line 60.wpdb— source line 61.prepare— source line 64.get_results— source line 65.get_var— source line 66.query— source line 75.get_row— source line 76.suppress_errors— source line 77.register_rest_route— source line 81.current_user_can— source line 82.rest_url— source line 83.wp_generate_uuid4— source line 112.
Imports and dependencies
- Line 6:
require $root.'/backend/bootstrap.php'; - Line 17:
use Hslg\Backend\Database\TableNames; - Line 18:
use Hslg\Backend\Database\Migrations\InitialSchema; - Line 19:
use Hslg\Backend\Database\Migrations\RecordSchemaV2; - Line 20:
use Hslg\Backend\Database\Migrations\AccountOrderSchemaV3; - Line 21:
use Hslg\Backend\Contracts\VenueRepository; - Line 22:
use Hslg\Backend\Services\Venues\ListVenues; - Line 84:
require $root.'/wordpress/hslg-app-api/src/database/WordPressVenueRepository.php'; - Line 85:
require $root.'/wordpress/hslg-app-api/src/database/SchemaInstaller.php'; - Line 86:
require $root.'/wordpress/hslg-app-api/src/database/WordPressCustomerRecordRepository.php'; - Line 87:
require $root.'/wordpress/hslg-app-api/src/Plugin.php'; - Line 88:
require $root.'/wordpress/hslg-app-api/src/controllers/FoundationController.php';
Behaviour and audit locations
- Line 37:
verify(str_contains($m56sql,'UNIQUE KEY customer_idempotency (customer_id,idempotency_key)'), 'draft idempotency per authenticated customer'); - Line 39:
verify(str_contains($m56sql,'DEFAULT CURRENT_TIMESTAMP(6)'), 'MariaDB stamps new records'); - Line 43:
verify(str_contains($recordSql,'DEFAULT CURRENT_TIMESTAMP(6)'),'database assigns write timestamp at microsecond precision'); - Line 81:
function register_rest_route($namespace,$route,$options):void{global $routes;$routes[$namespace.$route]=$options;} - Line 82:
function current_user_can($permission):bool{global $admin;return $admin;} - Line 98:
foreach($routes as $route=>$options)verify(isset($options['permission_callback']),'explicit permission policy for '.$route); - Line 99:
verify($controller->adminPermission() instanceof WP_Error,'anonymous admin diagnostics denied'); - Line 100:
$admin=true;verify($controller->adminPermission()===true,'authorised administrator permitted');
Relationship to the system
This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.
Change verification
Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.