Skip to content
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
8 changes: 8 additions & 0 deletions tests/GaletteActivities/Entity/tests/units/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ public function testCrud(): void
];
$this->assertFalse($activity->check($data));
$this->assertSame(['Name is mandatory'], $activity->getErrors());
$this->expectLogEntry(
\Analog::ERROR,
'Name is mandatory'
);

//required activity name
$data = [
Expand All @@ -94,6 +98,10 @@ public function testCrud(): void
];
$this->assertFalse($activity->check($data));
$this->assertSame(['Type is too long'], $activity->getErrors());
$this->expectLogEntry(
\Analog::ERROR,
'Type is too long'
);

//add new activity
$data = [
Expand Down
22 changes: 22 additions & 0 deletions tests/GaletteActivities/Entity/tests/units/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ public function testCrud(): void
],
$subscription->getErrors()
);
$this->expectLogEntry(
\Analog::ERROR,
'Activity is mandatory',
);

$data = [
'activity' => $activity_id,
Expand All @@ -148,6 +152,10 @@ public function testCrud(): void
],
$subscription->getErrors()
);
$this->expectLogEntry(
\Analog::ERROR,
'Member is mandatory',
);

$data = [
'activity' => $activity_id,
Expand All @@ -161,6 +169,10 @@ public function testCrud(): void
],
$subscription->getErrors()
);
$this->expectLogEntry(
\Analog::ERROR,
'Subscription date is mandatory',
);

$data = [
'activity' => $activity_id,
Expand All @@ -175,6 +187,10 @@ public function testCrud(): void
],
$subscription->getErrors()
);
$this->expectLogEntry(
\Analog::ERROR,
'- Wrong date format (Y-m-d) for Subscription date!',
);

$data = [
'activity' => $activity_id,
Expand Down Expand Up @@ -265,6 +281,12 @@ public function testCrud(): void
],
$subscription->getErrors()
);
$this->expectLogEntry(
\Analog::ERROR,
$this->zdb->isPostgres() ?
'duplicate key value violates unique constraint "galette_activities_subscriptions_id_activity_id_adh_key"' :
"Duplicate entry '3-1' for key"
);
}

/**
Expand Down