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') ); } }