Beispiel #1
0
 public function testDefaultValues()
 {
     $facet = new AfsFacet('foo');
     $this->assertTrue($facet->get_id() == 'foo');
     $this->assertEquals(AfsFacetType::UNKNOWN_TYPE, $facet->get_type());
     $this->assertEquals(AfsFacetLayout::TREE, $facet->get_layout());
     $this->assertEquals(AfsFacetMode::UNSPECIFIED_MODE, $facet->get_mode());
     $this->assertFalse($facet->has_or_mode());
     $this->assertFalse($facet->has_and_mode());
     $this->assertFalse($facet->has_single_mode());
 }
Beispiel #2
0
 /** @brief Checks whether provided facet is sticky or not.
  *
  * If facet mode is undefined, rely on default facet mode to determine
  * whether the facet is sticky or not.
  *
  * @param $facet [in] Facet for which mode should be determined.
  *
  * @return @c true when the facet is considered as sticky, @c false
  *         otherwise.
  */
 public function is_sticky(AfsFacet $facet)
 {
     $mode = $facet->get_mode();
     if (AfsFacetMode::UNSPECIFIED_MODE == $mode) {
         $mode = $this->facet_mode;
     }
     return $this->is_mode_sticky($mode);
 }