/** * @param $group * * @return \ingot\testing\object\price\test */ protected function setup_test_object($group) { if (is_numeric($group)) { $group = group::read($group); } if (!group::valid($group)) { return false; } $bandit = new \ingot\testing\bandit\price($group['ID']); $variant = $bandit->choose(); $product = \ingot\testing\utility\price::get_product($group); $test = new test(['plugin' => $group['sub_type'], 'ID' => $group['ID'], 'expires' => $this->expires(), 'variant' => $variant, 'product' => $product, 'price_callback' => \ingot\testing\utility\price::get_price_callback($group['sub_type'])]); return $test; }
/** * Set price callback property * * @since 1.1.0 * * @access private */ private function set_price_callback() { if (!isset($this->price_callback)) { $this->set_plugin(); $this->price_callback = price::get_price_callback($this->plugin); } }