ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.145.154.10 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/nicnAdmin/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ |
Upload File : |
<?php namespace Illuminate\Foundation\Testing\Concerns; trait InteractsWithAuthentication { /** * Assert that the user is authenticated. * * @param string|null $guard * @return $this */ public function seeIsAuthenticated($guard = null) { $this->assertTrue($this->isAuthenticated($guard), 'The user is not authenticated'); return $this; } /** * Assert that the user is not authenticated. * * @param string|null $guard * @return $this */ public function dontSeeIsAuthenticated($guard = null) { $this->assertFalse($this->isAuthenticated($guard), 'The user is authenticated'); return $this; } /** * Return true if the user is authenticated, false otherwise. * * @param string|null $guard * @return bool */ protected function isAuthenticated($guard = null) { return $this->app->make('auth')->guard($guard)->check(); } /** * Assert that the user is authenticated as the given user. * * @param $user * @param string|null $guard * @return $this */ public function seeIsAuthenticatedAs($user, $guard = null) { $expected = $this->app->make('auth')->guard($guard)->user(); $this->assertInstanceOf( get_class($expected), $user, 'The currently authenticated user is not who was expected' ); $this->assertSame( $expected->getAuthIdentifier(), $user->getAuthIdentifier(), 'The currently authenticated user is not who was expected' ); return $this; } /** * Assert that the given credentials are valid. * * @param array $credentials * @param string|null $guard * @return $this */ public function seeCredentials(array $credentials, $guard = null) { $this->assertTrue( $this->hasCredentials($credentials, $guard), 'The given credentials are invalid.' ); return $this; } /** * Assert that the given credentials are invalid. * * @param array $credentials * @param string|null $guard * @return $this */ public function dontSeeCredentials(array $credentials, $guard = null) { $this->assertFalse( $this->hasCredentials($credentials, $guard), 'The given credentials are valid.' ); return $this; } /** * Return true is the credentials are valid, false otherwise. * * @param array $credentials * @param string|null $guard * @return bool */ protected function hasCredentials(array $credentials, $guard = null) { $provider = $this->app->make('auth')->guard($guard)->getProvider(); $user = $provider->retrieveByCredentials($credentials); return $user && $provider->validateCredentials($user, $credentials); } }