CakeDC\Users\Test\TestCase\Auth\SocialAuthenticateTest::setUp PHP Метод

setUp() публичный Метод

This method is called before a test is executed.
public setUp ( )
    public function setUp()
    {
        $request = new Request();
        $response = new Response();
        $this->Table = TableRegistry::get('CakeDC/Users.Users');
        $this->Token = $this->getMockBuilder('League\\OAuth2\\Client\\Token\\AccessToken')->setMethods(['getToken', 'getExpires'])->disableOriginalConstructor()->getMock();
        $this->controller = $this->getMockBuilder('Cake\\Controller\\Controller')->setMethods(['failedSocialLogin', 'dispatchEvent'])->setConstructorArgs([$request, $response])->getMock();
        $this->controller->expects($this->any())->method('dispatchEvent')->will($this->returnValue(new Event('test')));
        $this->Request = $request;
        $this->SocialAuthenticate = $this->_getSocialAuthenticateMockMethods(['_authenticate', '_getProviderName', '_mapUser', '_socialLogin', 'dispatchEvent', '_validateConfig', '_getController']);
        $this->SocialAuthenticate->expects($this->any())->method('_getController')->will($this->returnValue($this->controller));
    }