mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
fixes for tests
This commit is contained in:
parent
f98f2902dc
commit
6561602fef
@ -151,6 +151,22 @@ class Client extends BaseModel
|
||||
return ClientSettings::buildClientSettings(new CompanySettings($this->company->settings), new ClientSettings($this->settings));
|
||||
}
|
||||
|
||||
public function getSetting($setting)
|
||||
{
|
||||
//check client level first
|
||||
if(property_exists($this->settings, $setting) && isset($this->settings->{$setting}))
|
||||
return $this->settings->{$setting};
|
||||
|
||||
//check group level (if a group is assigned)
|
||||
if($this->group_settings && property_exists($this->group_settings, $setting) && isset($this->group_settings->{$setting}))
|
||||
return $this->group_settings->{$setting};
|
||||
|
||||
//check company level
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function documents()
|
||||
{
|
||||
return $this->morphMany(Document::class, 'documentable');
|
||||
|
@ -139,12 +139,12 @@ class LoginTest extends TestCase
|
||||
$user = factory(User::class)->create([
|
||||
// 'account_id' => $account->id,
|
||||
'email' => 'test@example.com',
|
||||
'password' => '123456'
|
||||
'password' => \Hash::make('123456')
|
||||
]);
|
||||
|
||||
$company = factory(\App\Models\Company::class)->make([
|
||||
'account_id' => $account->id,
|
||||
'domain' => 'ninja.test',
|
||||
'domain' => 'ninja.test',
|
||||
|
||||
]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user