/** * Checks to see if a Give form has variable prices enabled. * * @since 1.0 * * @param int $form_id ID number of the form to check * * @return bool true if has variable prices, false otherwise */ function give_has_variable_prices($form_id = 0) { if (empty($form_id)) { return false; } $form = new Give_Donate_Form($form_id); return $form->has_variable_prices(); }
/** * Test Get Prices * * @covers Give_Donate_Form::get_prices */ public function test_get_prices() { $multi_form = new Give_Donate_Form($this->_multi_form->ID); $this->assertTrue($multi_form->has_variable_prices()); $this->assertFalse($multi_form->is_single_price_mode()); $prices = $multi_form->get_prices(); $this->assertEquals(4, count($prices)); }