| 1234567891011121314151617181920212223242526 |
- <?php
- namespace Tests\Unit;
- use App\Services\Agent\AgentDomainService;
- use PHPUnit\Framework\TestCase;
- use ReflectionMethod;
- class AgentDomainServiceTest extends TestCase
- {
- public function test_hash_router_registration_urls_keep_agent_code_inside_fragment_route(): void
- {
- $method = new ReflectionMethod(AgentDomainService::class, 'registerUrl');
- $method->setAccessible(true);
- $service = new AgentDomainService();
- $this->assertSame(
- 'https://pc.example.com/#/user/register?agent_code=ABC123',
- $method->invoke($service, 'https://pc.example.com', '/#/user/register', 'ABC123')
- );
- $this->assertSame(
- 'https://h5.example.com/#/pages/login/login?type=reg&agent_code=ABC123',
- $method->invoke($service, 'https://h5.example.com', '/#/pages/login/login?type=reg', 'ABC123')
- );
- }
- }
|