public function testAllNumericSelected() { update_option('fields', array('field1' => 1)); update_option('numeric', array('field1' => 1)); update_option('field1_range', '-10,10-20,20-'); global $wp_query; $wp_query->facets = array('field1' => array('-10' => 0, '10-20' => 3, '20-' => 7)); $_GET = array('field1' => array('and' => array('10-20'))); $this->assertEquals(array('field1' => array('available' => array('20-' => array('count' => 7, 'slug' => '20-', 'font' => 24.0, 'to' => '', 'from' => '20')), 'selected' => array('10-20' => array('slug' => '10-20', 'to' => '20', 'from' => '10', 'count' => 3)), 'total' => 7)), Faceting::all()); }
public static function _ajax_footer() { $html = ob_get_contents(); ob_clean(); \phpQuery::newDocumentHTML($html); global $wp_query; $result = array('content' => pq(self::$selector)->html(), 'faceting' => Faceting::all(), 'found' => $wp_query->found_posts); echo json_encode($result); if (!empty($_REQUEST)) { // only fail on webserver, not tests die; } }