WorldCupReferralServiceTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Tests\Unit;
  3. use App\Services\WorldCup\WorldCupReferralService;
  4. use Tests\TestCase;
  5. class WorldCupReferralServiceTest extends TestCase
  6. {
  7. public function test_first_deposit_one_hundred_twenty_rewards_sixty_each()
  8. {
  9. $service = new WorldCupReferralService();
  10. $reward = $service->calculateReward(12000);
  11. $this->assertSame(6000, $reward['reward_each']);
  12. $this->assertSame(12000, $reward['total_liability']);
  13. }
  14. public function test_first_deposit_three_hundred_caps_reward_at_one_hundred_each()
  15. {
  16. $service = new WorldCupReferralService();
  17. $reward = $service->calculateReward(30000);
  18. $this->assertSame(10000, $reward['reward_each']);
  19. $this->assertSame(20000, $reward['total_liability']);
  20. }
  21. public function test_invite_copy_matches_latest_frontend_requirement()
  22. {
  23. $service = new WorldCupReferralService();
  24. $copy = $service->getInviteCopy();
  25. $this->assertSame(
  26. 'When your friend makes their first deposit, you each get 50% of it (up to $100 each)',
  27. $copy['description']
  28. );
  29. $this->assertSame(
  30. 'Risk warning: Self-invites (same device/payment) and bulk or bot signups are banned — rewards frozen, permanent ban, clawback.',
  31. $copy['risk_warning']
  32. );
  33. }
  34. }