<?php
/**
 * Test Environment Implementation
 *
 * Handles test-specific operations including AEAT test endpoints.
 * Uses AEAT test endpoints and allows optional SSL verification bypass.
 *
 * @package Freefactu
 * @since 0.5.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require_once __DIR__ . '/abstract-base-environment.php';

/**
 * Class Freefactu_Test_Environment
 *
 * Test environment with AEAT test endpoints.
 * SSL verification can be disabled via settings for testing purposes.
 *
 * @see Freefactu_Base_Environment For shared implementation
 * @see Freefactu_Production_Environment For the production environment
 */
class Freefactu_Test_Environment extends Freefactu_Base_Environment {

	/**
	 * Constructor.
	 *
	 * What this function does:
	 * - Sets SOAP endpoint to AEAT test/pre-production URL
	 * - Sets QR base URL to AEAT test/pre-production URL
	 * - Initializes test environment configuration
	 *
	 * Where it's called from:
	 * - class-freefactu-factory.php: create_environment() method when environment is 'test' (default)
	 *
	 * @return void
	 */
	public function __construct() {
		$this->soap_endpoint = 'https://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP';
		$this->qr_base_url   = 'https://prewww2.aeat.es/wlpl/TIKE-CONT/ValidarQR';
	}

	/**
	 * Get environment name.
	 *
	 * What this function does:
	 * - Returns the string 'test'
	 * - Used for identifying the current environment
	 *
	 * Where it's called from:
	 * - Not currently used in the codebase (available for environment identification)
	 *
	 * @return string 'test'.
	 */
	public function get_environment_name(): string {
		return 'test';
	}
}
