34 lines
861 B
PHP
34 lines
861 B
PHP
<?php
|
|
|
|
use App\Models\UserAbo;
|
|
use App\Services\Incentive\IncentiveTracker;
|
|
|
|
it('nutzt member_id als Berater bei Kundenabo ot', function () {
|
|
$abo = new UserAbo([
|
|
'is_for' => 'ot',
|
|
'member_id' => 454,
|
|
'user_id' => null,
|
|
]);
|
|
|
|
expect(IncentiveTracker::consultantUserIdForAboIncentive($abo))->toBe(454);
|
|
});
|
|
|
|
it('nutzt user_id als Berater bei Eigenabo me', function () {
|
|
$abo = new UserAbo([
|
|
'is_for' => 'me',
|
|
'user_id' => 200,
|
|
'member_id' => null,
|
|
]);
|
|
|
|
expect(IncentiveTracker::consultantUserIdForAboIncentive($abo))->toBe(200);
|
|
});
|
|
|
|
it('liefert null wenn ot ohne member_id', function () {
|
|
$abo = new UserAbo([
|
|
'is_for' => 'ot',
|
|
'member_id' => null,
|
|
'user_id' => null,
|
|
]);
|
|
|
|
expect(IncentiveTracker::consultantUserIdForAboIncentive($abo))->toBeNull();
|
|
});
|