Skip to content

Commit

Permalink
Exception in tests prevents other tests to be executed
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Apr 26, 2024
1 parent c4b9366 commit 383a543
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/Galette/Entity/tests/units/Contribution.php
Expand Up @@ -379,18 +379,6 @@ public function testRetrieveEndDate(): void
$due_date->sub(new \DateInterval('P1D'));
$this->assertSame($due_date->format('Y-m-d'), $contrib->end_date);

//unset pref_beg_membership and pref_membership_ext
$preferences->pref_beg_membership = '';
$preferences->pref_membership_ext = '';

$this->expectException('RuntimeException');
$this->expectExceptionMessage('Unable to define end date; none of pref_beg_membership nor pref_membership_ext are defined!');
$contrib = new \Galette\Entity\Contribution(
$this->zdb,
$this->login,
['type' => 1] //annual fee
);

// Second, test with beginning of membership date
$preferences->pref_beg_membership = '29/05';
$due_date = new \DateTime();
Expand Down Expand Up @@ -426,6 +414,18 @@ public function testRetrieveEndDate(): void
$preferences->pref_beg_membership = $orig_pref_beg_membership;
$preferences->pref_membership_ext = $orig_pref_membership_ext;
$preferences->pref_membership_offermonths = $orig_pref_membership_offermonths;

//unset pref_beg_membership and pref_membership_ext
$preferences->pref_beg_membership = '';
$preferences->pref_membership_ext = '';

$this->expectException('RuntimeException');
$this->expectExceptionMessage('Unable to define end date; none of pref_beg_membership nor pref_membership_ext are defined!');
$contrib = new \Galette\Entity\Contribution(
$this->zdb,
$this->login,
['type' => 1] //annual fee
);
}

/**
Expand Down

0 comments on commit 383a543

Please sign in to comment.