From ee9363ada458a91544e4d9ad54b5cbbf0e54842d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 29 Apr 2014 07:34:04 -0700 Subject: [PATCH] add product api test: --- tests/phpunit/api/v3/ProductTest.php | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/phpunit/api/v3/ProductTest.php diff --git a/tests/phpunit/api/v3/ProductTest.php b/tests/phpunit/api/v3/ProductTest.php new file mode 100644 index 0000000000..0aca3aa959 --- /dev/null +++ b/tests/phpunit/api/v3/ProductTest.php @@ -0,0 +1,62 @@ + 'Product Tests', + 'description' => 'Test product API', + 'group' => 'CiviCRM API Tests', + ); + } + + function setUp() { + $this->_params = array( + 'name' => 'my product', + ); + } + + function tearDown() { + $this->quickCleanup(array('civicrm_product'), TRUE); + } + + function testGetFields() { + $fields = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create')); + $this->assertArrayHasKey('period_type', $fields['values']); + } + + function testGetOptions() { + $options = $this->callAPISuccess($this->_entity, 'getoptions', array('field' => 'period_type')); + $this->assertArrayHasKey('rolling', $options['values']); + } +} -- 2.25.1