reward(); $title = $this->callPrivate($repository, 'approvedInviteeMailTitle', [$reward]); $text = $this->callPrivate($repository, 'approvedInviteeMailText', [$reward]); $this->assertSame('Claim your $60 welcome reward', $title); $this->assertContains('Welcome! Your referral reward is ready to claim.', $text); $this->assertContains('You signed up with an invite and made your first deposit of $120.', $text); $this->assertContains('Reward: $60 (50% of your first deposit).', $text); $this->assertContains('Tap Claim to add it to your balance.', $text); } public function testInviteeRejectedMailUsesWelcomeRewardCopy(): void { $repository = new SqlWorldCupReviewRepository(); $reward = $this->reward(); $title = $this->callPrivate($repository, 'rejectedInviteeMailTitle', [$reward]); $text = $this->callPrivate($repository, 'rejectedInviteeMailText', [$reward, 'Same device']); $this->assertSame('Welcome reward not approved', $title); $this->assertContains('Your welcome reward could not be approved.', $text); $this->assertContains('Reason: Same device.', $text); $this->assertContains('If you think this is a mistake, contact support.', $text); } private function reward(): array { return [ 'reward_id' => 1, 'referrer_id' => 1001, 'invitee_id' => 1002, 'first_deposit_amt' => 12000, 'reward_each' => 6000, 'total_liability' => 12000, 'risk_level' => 'low', 'status' => 'reviewing', ]; } private function callPrivate(object $object, string $method, array $arguments) { $reflection = new ReflectionClass($object); $method = $reflection->getMethod($method); $method->setAccessible(true); return $method->invokeArgs($object, $arguments); } }