* @throws \CRM_Core_Exception
*/
protected function assertPostConditions() {
+ // Reset to version 3 as not all (e.g payments) work on v4
+ $this->_apiversion = 3;
if ($this->isLocationTypesOnPostAssert) {
$this->assertLocationValidity();
}
/**
* (non-PHPdoc)
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
* @see CiviUnitTestCase::tearDown()
*/
public function tearDown(): void {
'civicrm_activity',
];
$this->quickCleanup($tablesToTruncate, TRUE);
+ parent::tearDown();
}
/**
* @param int $version
* @dataProvider versionThreeAndFour
*/
- public function testActivityCreateCustomBefore($version) {
+ public function testActivityCreateCustomBefore($version): void {
$this->_apiversion = $version;
$values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
$this->assertTrue($values['count'] == 0);
$groupCount = $this->callAPISuccess('custom_group', 'getcount', ['extends' => 'activity']);
$this->assertEquals($groupCount, 1, 'one group should now exist');
$values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
- $this->assertTrue($values['count'] == 1, 'check that cached value is not retained for custom_group_id');
+ $this->assertEquals(1, $values['count'], 'check that cached value is not retained for custom_group_id');
}
}
* Takes no params.
* Testing mainly for format.
*/
- public function testGet() {
+ public function testGet(): void {
$params = ['sequential' => 1];
$result = $this->callAPIAndDocument('domain', 'get', $params, __FUNCTION__, __FILE__);