File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
tests/Unit/Models/Company Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public static function getIdForCurrentUser($unescaped_input)
116116 if ($ current_user ->company_id != null ) {
117117 return $ current_user ->company_id ;
118118 } else {
119- return static :: getIdFromInput ( $ unescaped_input ) ;
119+ return null ;
120120 }
121121 }
122122 }
Original file line number Diff line number Diff line change 44
55use App \Models \Company ;
66use App \Models \User ;
7+ use PHPUnit \Framework \Attributes \Group ;
78use Tests \TestCase ;
89
10+ #[Group('focus ' )]
911class GetIdForCurrentUserTest extends TestCase
1012{
1113 public function testReturnsProvidedValueWhenFullCompanySupportDisabled ()
@@ -32,11 +34,11 @@ public function testReturnsNonSuperUsersCompanyIdWhenFullCompanySupportEnabled()
3234 $ this ->assertEquals (2000 , Company::getIdForCurrentUser (1000 ));
3335 }
3436
35- public function testReturnsProvidedValueForNonSuperUserWithoutCompanyIdWhenFullCompanySupportEnabled ()
37+ public function testReturnsNullForNonSuperUserWithoutCompanyIdWhenFullCompanySupportEnabled ()
3638 {
3739 $ this ->settings ->enableMultipleFullCompanySupport ();
3840
3941 $ this ->actingAs (User::factory ()->create (['company_id ' => null ]));
40- $ this ->assertEquals ( 1000 , Company::getIdForCurrentUser (1000 ));
42+ $ this ->assertNull ( Company::getIdForCurrentUser (1000 ));
4143 }
4244}
You can’t perform that action at this time.
0 commit comments