public function testRetrieveDefaultParameters() { $acp = new AfsAcp('127.0.0.1', 666); $service = $acp->get_service(); $this->assertEquals(666, $service->id); $this->assertEquals(AfsServiceStatus::STABLE, $service->status); $acp->execute(); $url = $acp->get_generated_url(); $this->assertTrue(strpos($url, '127.0.0.1') !== False, 'URL does not contain right host'); $this->assertTrue(strpos($url, 'service=666') !== False, 'URL does not contain right sesrvice id'); $this->assertTrue(strpos($url, 'status=stable') !== False, 'URL does not contain right sesrvice status'); $config = $acp->get_helpers_configuration(); $this->assertEquals(AfsHelperFormat::ARRAYS, $config->get_helper_format()); }
<?php /** @file acp_helper_example.php * @example acp_helper_example.php */ require_once "PHP_API/afs_lib.php"; $acp = new AfsAcp('eval.partners.antidot.net', 48000); $acp->query('Men'); $helper = $acp->execute(AfsHelperFormat::HELPERS); ?> <html> <head> <title>Antidot PHP API - ACP helper example</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta charset="UTF-8"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../../assets/js/html5shiv.js"></script> <script src="../../assets/js/respond.min.js"></script> <![endif]--> </head> <body> <div class="page-header"> <h1>ACP helper example <small>based on the Antidot PHP API</small></h1> </div> <?php