Skip to content

Commit

Permalink
Fix contributions types tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed May 9, 2024
1 parent 73e3ab1 commit d98ee57
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions tests/Galette/Entity/tests/units/ContributionsTypes.php
Expand Up @@ -97,11 +97,19 @@ public function testContributionsTypes(): void

$this->assertSame(
-2,
$ctype->add('annual fee', 10, false)
$ctype->add(
'annual fee',
10,
\Galette\Entity\ContributionsTypes::DONATION_TYPE
)
);

$this->assertTrue(
$ctype->add('Test contribution type', null, false)
$ctype->add(
'Test contribution type',
null,
\Galette\Entity\ContributionsTypes::DONATION_TYPE
)
);

$this->remove[] = $ctype->id;
Expand Down Expand Up @@ -133,11 +141,21 @@ public function testContributionsTypes(): void

$this->assertSame(
\Galette\Entity\ContributionsTypes::ID_NOT_EXITS,
$ctype->update(42, 'annual fee', 10, false)
$ctype->update(
42,
'annual fee',
10,
\Galette\Entity\ContributionsTypes::DONATION_TYPE
)
);

$this->assertTrue(
$ctype->update($id, 'Tested contribution type', 42, true)
$ctype->update(
$id,
'Tested contribution type',
42,
\Galette\Entity\ContributionsTypes::DEFAULT_TYPE
)
);

$this->assertSame(
Expand All @@ -150,7 +168,7 @@ public function testContributionsTypes(): void

$this->assertSame('Tested contribution type', $test_ctype['libelle_type_cotis']);
$this->assertSame(42.0, (float)$test_ctype['amount']);
$this->assertSame(1, $test_ctype['cotis_extension']);
$this->assertSame(\Galette\Entity\ContributionsTypes::DEFAULT_TYPE, $test_ctype['cotis_extension']);

$select = $this->zdb->select(\Galette\Core\L10n::TABLE);
$select->where(
Expand Down

0 comments on commit d98ee57

Please sign in to comment.