+ public function testNewPriceField(): void {
+ $this->createLoggedInUser();
+
+ $priceSetId = $this->callAPISuccess('PriceSet', 'create', [
+ 'is_active' => 1,
+ // extends contribution
+ 'extends' => 2,
+ 'is_quick_config' => 0,
+ // donation
+ 'financial_type_id' => 1,
+ 'name' => 'priciest',
+ 'title' => 'Priciest Price Set',
+ ])['id'];
+
+ $_SERVER['REQUEST_URI'] = "civicrm/admin/price/field?reset=1&action=add&sid={$priceSetId}";
+ $_GET['q'] = 'civicrm/admin/price/field';
+ $_REQUEST['reset'] = 1;
+ $_REQUEST['action'] = 'add';
+ $_REQUEST['sid'] = $priceSetId;
+
+ $item = CRM_Core_Invoke::getItem([$_GET['q']]);
+ ob_start();
+ CRM_Core_Invoke::runItem($item);
+ ob_end_clean();
+
+ unset($_REQUEST['reset']);
+ unset($_REQUEST['action']);
+ unset($_REQUEST['sid']);
+
+ $this->callAPISuccess('PriceSet', 'delete', ['id' => $priceSetId]);
+ }
+