3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Class api_v3_ProductTest
16 class api_v3_ProductTest
extends CiviUnitTestCase
{
17 protected $_apiversion = 3;
20 protected $_entity = 'Product';
22 public function setUp() {
24 $this->useTransaction();
26 'name' => 'my product',
30 public function testGetFields() {
31 $fields = $this->callAPISuccess($this->_entity
, 'getfields', ['action' => 'create']);
32 $this->assertArrayHasKey('period_type', $fields['values']);
35 public function testGetOptions() {
36 $options = $this->callAPISuccess($this->_entity
, 'getoptions', ['field' => 'period_type']);
37 $this->assertArrayHasKey('rolling', $options['values']);