Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix profile test teardown #20439

Merged
merged 1 commit into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Civi/Test/ContactTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ trait ContactTestTrait {
/**
* Emulate a logged in user since certain functions use that.
* value to store a record in the DB (like activity)
*
* @see https://issues.civicrm.org/jira/browse/CRM-8180
*
* @return int
* Contact ID of the created user.
* @throws \CiviCRM_API3_Exception
*/
public function createLoggedInUser() {
public function createLoggedInUser(): int {
$params = [
'first_name' => 'Logged In',
'last_name' => 'User ' . rand(),
Expand Down
5 changes: 3 additions & 2 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Civi\Api4\RelationshipType;
use Civi\Payment\System;
use Civi\Api4\OptionValue;
use Civi\Test\Api3DocTrait;
use League\Csv\Reader;

/**
Expand Down Expand Up @@ -58,7 +59,7 @@
*/
class CiviUnitTestCase extends PHPUnit\Framework\TestCase {

use \Civi\Test\Api3DocTrait;
use Api3DocTrait;
use \Civi\Test\GenericAssertionsTrait;
use \Civi\Test\DbTestTrait;
use \Civi\Test\ContactTestTrait;
Expand Down Expand Up @@ -3122,7 +3123,7 @@ protected function enableTaxAndInvoicing($params = []) {
*
* @throws \CRM_Core_Exception
*/
protected function disableTaxAndInvoicing() {
protected function disableTaxAndInvoicing(): \Civi\Core\SettingsBag {
$accounts = $this->callAPISuccess('EntityFinancialAccount', 'get', ['account_relationship' => 'Sales Tax Account is'])['values'];
foreach ($accounts as $account) {
$this->callAPISuccess('EntityFinancialAccount', 'delete', ['id' => $account['id']]);
Expand Down
Loading