CakeDC\Users\Test\TestCase\Controller\Component\UsersAuthComponentTest::setUp PHP Method

setUp() public method

setUp method
public setUp ( ) : void
return void
    public function setUp()
    {
        parent::setUp();
        $this->backupUsersConfig = Configure::read('Users');
        Router::reload();
        Plugin::routes('CakeDC/Users');
        Router::connect('/route/*', ['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'requestResetPassword']);
        Router::connect('/notAllowed/*', ['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'edit']);
        Security::salt('YJfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi');
        Configure::write('App.namespace', 'Users');
        $this->request = $this->getMockBuilder('Cake\\Network\\Request')->setMethods(['is', 'method'])->getMock();
        $this->request->expects($this->any())->method('is')->will($this->returnValue(true));
        $this->response = $this->getMockBuilder('Cake\\Network\\Response')->setMethods(['stop'])->getMock();
        $this->Controller = new Controller($this->request, $this->response);
        $this->Registry = $this->Controller->components();
        $this->Controller->UsersAuth = new UsersAuthComponent($this->Registry);
    }