/**
  * Test that cost ranges return appropriate data
  */
 public function test_parse_cost_range()
 {
     $costs = array(5, 10, 1.5, '1 - 15', '$6');
     $cost_utils = Tribe__Events__Cost_Utils::instance();
     $range = $cost_utils->parse_cost_range($costs);
     $this->assertEquals(array(10 => '1', 15 => '1.5', 50 => '5', 60 => '6', 100 => '10', 150 => '15'), $range);
     $range = $cost_utils->parse_cost_range(array(10));
     $this->assertEquals(array(10 => '10'), $range);
     $range = $cost_utils->parse_cost_range(array('Free'));
     $this->assertEquals(array('free' => 'Free'), $range);
 }
コード例 #2
0
ファイル: general.php プロジェクト: TMBR/johnjohn
 /**
  * Get the maximum cost of all events.
  *
  * @category Cost
  * @return int the maximum cost.
  */
 function tribe_get_maximum_cost()
 {
     return Tribe__Events__Cost_Utils::instance()->get_maximum_cost();
 }
コード例 #3
0
 /**
  * Indicates if there events without a specific cost (as distinct from
  * free events).
  *
  * @return bool if uncosted events exist
  */
 function tribe_has_uncosted_events()
 {
     return Tribe__Events__Cost_Utils::instance()->has_uncosted_events();
 }
コード例 #4
0
 private function has_non_numeric_costs()
 {
     $costs = Tribe__Events__Cost_Utils::instance()->get_all_costs();
     foreach ($costs as $index => $cost) {
         if (is_numeric($index)) {
             unset($costs[$index]);
         }
     }
     return !empty($costs);
 }