CakeDC\Users\Test\TestCase\Auth\SocialAuthenticateTest::testGetUserSessionData PHP Method

testGetUserSessionData() public method

Test getUser
    public function testGetUserSessionData()
    {
        $user = ['username' => 'username', 'email' => '[email protected]'];
        $this->SocialAuthenticate = $this->_getSocialAuthenticateMockMethods(['_authenticate', '_getProviderName', '_mapUser', '_touch', '_validateConfig']);
        $session = $this->getMockBuilder('Cake\\Network\\Session')->setMethods(['read', 'delete'])->getMock();
        $session->expects($this->once())->method('read')->with('Users.social')->will($this->returnValue($user));
        $session->expects($this->once())->method('delete')->with('Users.social');
        $this->Request = $this->getMockBuilder('Cake\\Network\\Request')->setMethods(['session'])->getMock();
        $this->Request->expects($this->any())->method('session')->will($this->returnValue($session));
        $this->SocialAuthenticate->expects($this->once())->method('_touch')->will($this->returnValue($user));
        $this->SocialAuthenticate->getUser($this->Request);
    }