-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19283 from eileenmcnaughton/facl
Move financial acl warning from FinancialType BAO to extension.
- Loading branch information
Showing
4 changed files
with
71 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ext/financialacls/tests/phpunit/Civi/Financialacls/FinancialTypeTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Civi\Financialacls; | ||
|
||
use Civi; | ||
use CRM_Core_Session; | ||
|
||
// I fought the Autoloader and the autoloader won. | ||
require_once 'BaseTestClass.php'; | ||
|
||
/** | ||
* @group headless | ||
*/ | ||
class FinancialTypeTest extends BaseTestClass { | ||
|
||
/** | ||
* Test that a message is put in session when changing the name of a | ||
* financial type. | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function testChangeFinancialTypeName(): void { | ||
Civi::settings()->set('acl_financial_type', TRUE); | ||
$type = $this->callAPISuccess('FinancialType', 'create', [ | ||
'name' => 'my test', | ||
]); | ||
$this->callAPISuccess('FinancialType', 'create', [ | ||
'name' => 'your test', | ||
'id' => $type['id'], | ||
]); | ||
$status = CRM_Core_Session::singleton()->getStatus(TRUE); | ||
$this->assertEquals('Changing the name', substr($status[0]['text'], 0, 17)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters