FOC\Authenticate\Auth\Test\TestCase\Auth\CookieAuthenticateTest::setUp PHP Метод

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

setup
public setUp ( ) : void
Результат void
    public function setUp()
    {
        parent::setUp();
        $this->request = new Request('posts/index');
        Router::setRequestInfo($this->request);
        $this->response = $this->getMock('Cake\\Network\\Response');
        Security::salt('somerandomhaskeysomerandomhaskey');
        $this->Registry = new ComponentRegistry(new Controller($this->request, $this->response));
        $this->Registry->load('Cookie');
        $this->Registry->load('Auth');
        $this->auth = new CookieAuthenticate($this->Registry, ['fields' => ['username' => 'user_name', 'password' => 'password'], 'userModel' => 'MultiUsers']);
        $password = password_hash('password', PASSWORD_DEFAULT);
        $MultiUsers = TableRegistry::get('MultiUsers');
        $MultiUsers->updateAll(['password' => $password], []);
    }