public function testBuildQueryFromFeedFilterParameter() { $coder = new AfsQueryCoder(); $query = $coder->build_query(array('filter@Catalog' => 'FOO_bar_baz')); $this->assertEquals(1, count($query->get_filters())); $this->assertFalse($query->has_filter('FOO', 'bat', 'feed')); $this->assertFalse($query->has_filter('FOO', 'baz', 'feed')); }
* @example full_example.php */ /** [Include lib] */ require_once "PHP_API/afs_lib.php"; /** [Include lib] */ /** [Twig init] */ // You shoud addapt following paths require_once "/var/www/php-example/Twig-1.15.0/lib/Twig/Autoloader.php"; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem('/var/www/php-example/templates'); $twig = new Twig_Environment($loader, array('debug' => true)); $twig->addExtension(new Twig_Extension_Debug()); /** [Twig init] */ // Coder/Decoder and Query /** [Coder/decoder and Query] */ $coder = new AfsQueryCoder('full_example.php'); $query = $coder->build_query($_GET); /** [Coder/decoder and Query] */ // Connector /** [Connector] */ $service = new AfsService(70000, AfsServiceStatus::STABLE); $host = 'eval.partners.antidot.net'; $connector = new AfsSearchConnector($host, $service); /** [Connector] */ // Configuration /** [Helper configuration] */ $config = new AfsHelperConfiguration(); $config->set_query_coder($coder); $config->set_helper_format(AfsHelperFormat::ARRAYS); /** [Helper configuration] */ // Facets and Facet Manager