/** * @dataProvider detectRPCDataProvider */ function testDetectRPC($invocationPath, $rpcInvocationPath, $expectIsRPC, $explanation) { $explanation .= str_pad("\nSimulated URL:", 40) . $invocationPath; $explanation .= str_pad("\nSimulated rpcInvocationPath:", 40) . $rpcInvocationPath; // FAKE RPC $fakeRPC = new WFRPC(); $fakeRPC->setInvocationPath($rpcInvocationPath)->setTarget('foo')->setAction('bar'); $_REQUEST = $fakeRPC->rpcAsParameters(); $rpc = WFRPC::rpcFromRequest($invocationPath); if ($expectIsRPC) { $this->assertNotNull($rpc, $explanation); } else { $this->assertNull($rpc, $explanation); } }