-
@@ -134,9 +134,9 @@
-
format('c');
$this->setting->setSettingKey('allow_user_dashboards');
$this->setting->setValueEncoded(true);
$this->setting->setUpdatedAt($now);
@@ -107,7 +107,7 @@ public function testJsonSerialize(): void
$this->assertIsArray($serialized);
$this->assertSame('allow_user_dashboards', $serialized['key']);
$this->assertTrue($serialized['value']);
- $this->assertSame($now->format('c'), $serialized['updatedAt']);
+ $this->assertSame($now, $serialized['updatedAt']);
$this->assertArrayHasKey('id', $serialized);
}
diff --git a/tests/Unit/Db/ConditionalRuleTest.php b/tests/Unit/Db/ConditionalRuleTest.php
index f53e6ecc..12685862 100644
--- a/tests/Unit/Db/ConditionalRuleTest.php
+++ b/tests/Unit/Db/ConditionalRuleTest.php
@@ -145,7 +145,7 @@ public function testSetRuleConfigArray(): void
public function testJsonSerialize(): void
{
- $now = new DateTime();
+ $now = (new DateTime())->format('c');
$this->rule->setWidgetPlacementId(10);
$this->rule->setRuleType(ConditionalRule::TYPE_GROUP);
$this->rule->setRuleConfigArray(['groups' => ['admin']]);
@@ -159,7 +159,7 @@ public function testJsonSerialize(): void
$this->assertSame('group', $serialized['ruleType']);
$this->assertSame(['groups' => ['admin']], $serialized['ruleConfig']);
$this->assertTrue($serialized['isInclude']);
- $this->assertSame($now->format('c'), $serialized['createdAt']);
+ $this->assertSame($now, $serialized['createdAt']);
$this->assertArrayHasKey('id', $serialized);
}
diff --git a/tests/Unit/Service/DashboardFactoryTest.php b/tests/Unit/Service/DashboardFactoryTest.php
index 046722e2..9df16ced 100644
--- a/tests/Unit/Service/DashboardFactoryTest.php
+++ b/tests/Unit/Service/DashboardFactoryTest.php
@@ -111,6 +111,28 @@ public function testCreateSetsPermissionFull(): void
$this->assertSame(Dashboard::PERMISSION_FULL, $dashboard->getPermissionLevel());
}
+ public function testCreateRespectsExplicitPermissionLevel(): void
+ {
+ $dashboard = $this->factory->create(
+ userId: 'alice',
+ name: 'Test',
+ permissionLevel: Dashboard::PERMISSION_ADD_ONLY
+ );
+
+ $this->assertSame(Dashboard::PERMISSION_ADD_ONLY, $dashboard->getPermissionLevel());
+ }
+
+ public function testCreateRespectsExplicitGridColumns(): void
+ {
+ $dashboard = $this->factory->create(
+ userId: 'alice',
+ name: 'Test',
+ gridColumns: 6
+ );
+
+ $this->assertSame(6, $dashboard->getGridColumns());
+ }
+
public function testCreateSetsIsActive(): void
{
$dashboard = $this->factory->create(