Page MenuHomePhorge

UserTest.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

UserTest.php

<?php
namespace Tests\Feature;
use App\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class UserTest extends TestCase
{
/**
Verify a wallet assigned a controller is among the accounts of the assignee.
@return void
*/
public function testListUserAccounts()
{
$userA = User::firstOrCreate(
[
'email' => 'UserAccountA@UserAccount.com'
]
);
$this->assertTrue($userA->wallets()->count() == 1);
$userA->wallets()->each(
function ($wallet) {
$userB = User::firstOrCreate(
[
'email' => 'UserAccountB@UserAccount.com'
]
);
$wallet->addController($userB);
}
);
$userB = User::firstOrCreate(
[
'email' => 'UserAccountB@UserAccount.com'
]
);
$this->assertTrue($userB->accounts()->get()[0]->id === $userA->wallets()->get()[0]->id);
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 10:30 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18773070
Default Alt Text
UserTest.php (1 KB)

Event Timeline