public function testRetrieveSpecificParameters() { $search = new AfsSearch('127.0.0.2', 42, AfsServiceStatus::RC); $service = $search->get_service(); $this->assertEquals(42, $service->id); $this->assertEquals(AfsServiceStatus::RC, $service->status); $search->execute(AfsHelperFormat::ARRAYS); $url = $search->get_generated_url(); $this->assertTrue(strpos($url, '127.0.0.2') !== False, 'URL does not contain right host'); $this->assertTrue(strpos($url, 'service=42') !== False, 'URL does not contain right sesrvice id'); $this->assertTrue(strpos($url, 'status=rc') !== False, 'URL does not contain right sesrvice status'); $config = $search->get_helpers_configuration(); $this->assertEquals(AfsHelperFormat::ARRAYS, $config->get_helper_format()); }
<div class="col-md-2"> <!-- ####################### Relevance ########################### --> <?php if ($query->has_sort(AfsSortBuiltins::RELEVANCE)) { if ($query->get_sort_order(AfsSortBuiltins::RELEVANCE) == AfsSortOrder::ASC) { $relevance_icon = 'glyphicon-arrow-up'; $relevance_query = $query->add_sort(AfsSortBuiltins::RELEVANCE, AfsSortOrder::DESC); } else { $relevance_icon = 'glyphicon-arrow-down'; $relevance_query = $query->add_sort(AfsSortBuiltins::RELEVANCE, AfsSortOrder::ASC); } } else { $relevance_query = $query->add_sort(AfsSortBuiltins::RELEVANCE, AfsSortOrder::ASC); $relevance_icon = 'glyphicon-arrow-down'; } $relevance_link = $search->get_helpers_configuration()->get_query_coder()->generate_link($relevance_query); ?> <a href="<?php echo $relevance_link; ?> " class="btn btn-default btn-lg active" role="button"><span class="glyphicon <?php echo $relevance_icon; ?> "></span> Relevance</a> </div> <div class="col-md-2"> <?php $query_coder = $search->get_helpers_configuration()->get_query_coder(); if ($clustering_is_active) { $cluster_query = $query->unset_cluster(); $cluster_link = $query_coder->generate_link($query->unset_cluster());