Mpociot\Teamwork\Teamwork::user PHP Method

user() public method

Get the currently authenticated user or null.
public user ( )
    public function user()
    {
        return $this->app->auth->user();
    }

Usage Example

Example #1
0
 public function testUser()
 {
     /*
     |------------------------------------------------------------
     | Set
     |------------------------------------------------------------
     */
     $app = new stdClass();
     $app->auth = m::mock('Auth');
     $teamwork = new Teamwork($app);
     $user = m::mock('_mockedUser');
     /*
     |------------------------------------------------------------
     | Expectation
     |------------------------------------------------------------
     */
     $app->auth->shouldReceive('user')->andReturn($user)->once();
     /*
     |------------------------------------------------------------
     | Assertion
     |------------------------------------------------------------
     */
     $this->assertSame($user, $teamwork->user());
 }
All Usage Examples Of Mpociot\Teamwork\Teamwork::user