-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
39 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,6 @@ public function toSearchableArray() | |
return [ | ||
]; | ||
} | ||
|
||
protected $table = 'edition_student_association'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Traits; | ||
|
||
trait HasReferralLink | ||
{ | ||
public function get_referral_link(): string | ||
{ | ||
return 'TODO: implement this'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,14 @@ | |
|
||
namespace Tests\Feature; | ||
|
||
use App\Models\User; | ||
use App\Models\Participant; | ||
use App\Models\StudentAssociation; | ||
use App\Models\User; | ||
use App\Providers\RouteServiceProvider; | ||
use Illuminate\Support\Facades\Hash; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Tests\TestCase; | ||
use Illuminate\Support\Facades\Hash; | ||
use Laravel\Fortify\Features; | ||
use Laravel\Jetstream\Jetstream; | ||
use Tests\TestCase; | ||
|
||
class ReferalTest extends TestCase | ||
{ | ||
|
@@ -63,7 +62,6 @@ public function test_new_users_can_register_with_promoter_code(): void | |
$promoter_code = 'NUC-1'; | ||
$association_name = 'Test Association'; | ||
|
||
|
||
$association_data = [ | ||
'name' => $association_name, | ||
'email' => '[email protected]', | ||
|
@@ -76,14 +74,13 @@ public function test_new_users_can_register_with_promoter_code(): void | |
$test_association = StudentAssociation::create( | ||
[ | ||
'user_id' => $association_user->id, | ||
'name' => $association_data['name'], | ||
'code' => $promoter_code | ||
'name' => $association_data['name'], | ||
'code' => $promoter_code, | ||
] | ||
); | ||
$association_user->usertype()->associate($test_association); | ||
$association_user->save(); | ||
|
||
|
||
$response = $this->post('/register/', [ | ||
'name' => $username, | ||
'email' => '[email protected]', | ||
|