Eccube\Tests\Web\Admin\IndexControllerTest::testChangePasswordWithPost PHP Method

testChangePasswordWithPost() public method

    public function testChangePasswordWithPost()
    {
        $this->logIn($this->Member);
        $client = $this->client;
        $form = $this->createChangePasswordFormData();
        $crawler = $client->request('POST', $this->app->path('admin_change_password'), array('admin_change_password' => $form));
        $this->assertTrue($client->getResponse()->isRedirect($this->app->url('admin_change_password')));
        $Member = clone $this->Member;
        $Member->setPassword($form['change_password']['first']);
        $this->expected = $this->app['eccube.repository.member']->encryptPassword($Member);
        $this->actual = $this->Member->getPassword();
        // XXX 実行タイミングにより、稀にパスワード変更前のハッシュ値を参照する場合があるため、変更に成功した場合のみ assertion を実行する
        $old_password = hash_hmac('sha256', 'password' . ':' . $this->app['config']['auth_magic'], $this->Member->getSalt());
        if ($this->actual === $old_password) {
            $this->markTestSkipped('Failed to change the password by HttpClient. Skip this test.');
        }
        $this->verify('パスワードのハッシュ値が異なります ' . PHP_EOL . ' AUTH_MAGIC=' . $this->app['config']['auth_magic'] . PHP_EOL . ' HASH_Algos=' . $this->app['config']['password_hash_algos'] . PHP_EOL . ' Input Password=' . $form['change_password']['first'] . PHP_EOL . ' Expected: salt=' . $Member->getSalt() . ', raw password=' . $Member->getPassword() . PHP_EOL . ' Actual: salt=' . $this->Member->getSalt());
    }