HSLG Media

milestones-5-6-integration-doubles.php

milestones-5-6-integration-doubles.php

Source file: tests/backend/milestones-5-6-integration-doubles.php

Module: tests-backend

Size: 157 lines

SHA-256: 4b0c59e961c86a4ffd30e8b2f2e351d67249768b8a93db90d712c9e85dd126cf

Responsibility

Checks PHP backend assumptions; database doubles are not live MariaDB evidence.

Declared entry points

  • WP_REST_Controller — source line 10.
  • WP_REST_Request — source line 11.
  • __construct — source line 12.
  • get_json_params — source line 13.
  • get_header — source line 14.
  • get_param — source line 15.
  • WP_REST_Response — source line 17.
  • __construct — source line 19.
  • header — source line 20.
  • WP_Error — source line 22.
  • __construct — source line 23.
  • register_rest_route — source line 25.
  • is_ssl — source line 26.
  • wp_salt — source line 27.
  • wp_generate_uuid4 — source line 28.
  • wp_mail — source line 30.
  • wpdb — source line 31.
  • prepare — source line 35.
  • unpack — source line 36.
  • get_row — source line 37.
  • query — source line 57.
  • ok56 — source line 99.
  • denied56 — source line 100.

Imports and dependencies

  • Line 8: require $root.'/backend/bootstrap.php';
  • Line 91: use Hslg\Backend\Database\TableNames;
  • Line 92: use Hslg\WordPressApi\Database\WordPressCustomerAuthRepository;
  • Line 93: use Hslg\WordPressApi\Database\WordPressOrderDraftRepository;
  • Line 94: use Hslg\WordPressApi\Controllers\AccountOrderController;
  • Line 95: require $root.'/wordpress/hslg-app-api/src/database/WordPressCustomerAuthRepository.php';
  • Line 96: require $root.'/wordpress/hslg-app-api/src/database/WordPressOrderDraftRepository.php';
  • Line 97: require $root.'/wordpress/hslg-app-api/src/controllers/AccountOrderController.php';
  • Line 144: require $root.'/wordpress/hslg-app-api/src/database/WordPressCustomerRecordRepository.php';

Behaviour and audit locations

  • Line 25: function register_rest_route($ns,$path,$args):void{global $routes;$routes[$ns.$path]=$args;}
  • Line 30: function wp_mail($to,$subject,$body):bool{global $emails;$emails[]=[$to,$subject,$body];return true;}
  • Line 49: if (str_contains($sql,'FROM %i WHERE customer_id = %s AND idempotency_key = %s')) {
  • Line 85: 'table_number'=>$a[4],'idempotency_key'=>$a[5],'request_hash'=>$a[6],
  • Line 132: ok56($repeat['order_id']===$draft['order_id']&&count($db->drafts)===1,'M6 duplicate idempotency key resolves original draft');
  • Line 148: foreach (['/account/me','/account/profile','/account/logout','/orders/drafts','/orders/drafts/by-key/(?P<idempotency_key>[a-z0-9-]+)'] as $path) {
  • Line 149: ok56(is_array($routes['hslg/v1'.$path]['permission_callback']),'M5/M6 private route has session authorization: '.$path);
  • Line 151: $bad=$controller->permission(new WP_REST_Request());

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.