/** * test empty message */ public function testEmptyMessage() { $config = new Amfphp_Core_Config(); $gateway = new Amfphp_Core_Gateway(array(), array(), array(), Amfphp_Core_Amf_Constants::CONTENT_TYPE, $config); $ret = $gateway->service(); $this->assertTrue(strpos($ret, 'service') != false); }
/** * test service */ public function testService() { $amfTestData = new AmfTestData(); $testServiceConfig = new TestServicesConfig(); $testServiceConfig->serviceFolders = $testServiceConfig->serviceFolders; $testServiceConfig->serviceNames2ClassFindInfo = $testServiceConfig->serviceNames2ClassFindInfo; $gateway = new Amfphp_Core_Gateway(array(), array(), $amfTestData->testServiceRequestPacket, Amfphp_Core_Amf_Constants::CONTENT_TYPE, $testServiceConfig); $ret = $gateway->service(); $this->assertEquals(bin2hex($amfTestData->testServiceResponsePacket), bin2hex($ret)); }
<?php // phpinfo(); require_once dirname(__FILE__) . '/../../Amfphp/ClassLoader.php'; require_once dirname(__FILE__) . '/../../Tests/TestData/TestServicesConfig.php'; //load input amf data path from command line arguments $request = file_get_contents($argv[1]); $config = new TestServicesConfig(); $gateway = new Amfphp_Core_Gateway(array(), array(), $request, 'application/x-amf', $config); $gateway->service(); $gateway->output();