mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-28 14:54:44 +02:00
Moved the "ENFORCE_CHANGE_COMMENTS_FOR" type to the HistorySettings class
This commit is contained in:
parent
6df7bc5f2a
commit
5ab6a63492
9 changed files with 147 additions and 16 deletions
|
@ -24,13 +24,17 @@ namespace App\Tests\Services\LogSystem;
|
|||
|
||||
use App\Services\LogSystem\EventCommentNeededHelper;
|
||||
use App\Services\LogSystem\EventCommentType;
|
||||
use App\Settings\SystemSettings\HistorySettings;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class EventCommentNeededHelperTest extends TestCase
|
||||
{
|
||||
public function testIsCommentNeeded(): void
|
||||
{
|
||||
$service = new EventCommentNeededHelper([EventCommentType::PART_CREATE, EventCommentType::PART_EDIT]);
|
||||
$settings = new HistorySettings();
|
||||
$settings->enforceComments = [EventCommentType::PART_CREATE, EventCommentType::PART_EDIT];
|
||||
|
||||
$service = new EventCommentNeededHelper($settings);
|
||||
$this->assertTrue($service->isCommentNeeded(EventCommentType::PART_CREATE));
|
||||
$this->assertTrue($service->isCommentNeeded(EventCommentType::PART_EDIT));
|
||||
$this->assertFalse($service->isCommentNeeded(EventCommentType::DATASTRUCTURE_EDIT));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue