Commit | Line | Data |
---|---|---|
ee9363ad | 1 | <?php |
7d61e75f TO |
2 | /* |
3 | +--------------------------------------------------------------------+ | |
4 | | Copyright CiviCRM LLC. All rights reserved. | | |
5 | | | | |
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 | +--------------------------------------------------------------------+ | |
ee9363ad EM |
10 | */ |
11 | ||
e9479dcf EM |
12 | /** |
13 | * Class api_v3_ProductTest | |
acb109b7 | 14 | * @group headless |
e9479dcf | 15 | */ |
ee9363ad EM |
16 | class api_v3_ProductTest extends CiviUnitTestCase { |
17 | protected $_apiversion = 3; | |
18 | protected $_params; | |
19 | ||
20 | protected $_entity = 'Product'; | |
4cbe18b8 | 21 | |
00be9182 | 22 | public function setUp() { |
1811e4ba TO |
23 | parent::setUp(); |
24 | $this->useTransaction(); | |
9099cab3 | 25 | $this->_params = [ |
ee9363ad | 26 | 'name' => 'my product', |
9099cab3 | 27 | ]; |
ee9363ad EM |
28 | } |
29 | ||
00be9182 | 30 | public function testGetFields() { |
9099cab3 | 31 | $fields = $this->callAPISuccess($this->_entity, 'getfields', ['action' => 'create']); |
ee9363ad EM |
32 | $this->assertArrayHasKey('period_type', $fields['values']); |
33 | } | |
34 | ||
00be9182 | 35 | public function testGetOptions() { |
9099cab3 | 36 | $options = $this->callAPISuccess($this->_entity, 'getoptions', ['field' => 'period_type']); |
ee9363ad EM |
37 | $this->assertArrayHasKey('rolling', $options['values']); |
38 | } | |
96025800 | 39 | |
ee9363ad | 40 | } |