From 8afebc6338527de5edebd1ba4e5396400a050a46 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 19 Oct 2016 15:02:35 +0900 Subject: [PATCH] =?UTF-8?q?=E6=99=82=E6=8A=98=E5=A4=B1=E6=95=97=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Repository/ProductRepositoryGetQueryBuilderBySearchDataAdminTest - 在庫の初期化処理を修正 - Web/Admin/IndexControllerTest - テストが失敗した場合に詳細を出力 --- ...positoryGetQueryBuilderBySearchDataAdminTest.php | 13 +++++++++++++ .../Eccube/Tests/Web/Admin/IndexControllerTest.php | 12 ++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/Eccube/Tests/Repository/ProductRepositoryGetQueryBuilderBySearchDataAdminTest.php b/tests/Eccube/Tests/Repository/ProductRepositoryGetQueryBuilderBySearchDataAdminTest.php index e1a4a207d1f..1223010125a 100644 --- a/tests/Eccube/Tests/Repository/ProductRepositoryGetQueryBuilderBySearchDataAdminTest.php +++ b/tests/Eccube/Tests/Repository/ProductRepositoryGetQueryBuilderBySearchDataAdminTest.php @@ -130,6 +130,19 @@ public function testLinkStatus() public function testStockStatus() { + $faker = $this->getFaker(); + // 全商品の在庫を 1 以上にしておく + $Products = $this->app['eccube.repository.product']->findAll(); + foreach ($Products as $Product) { + foreach ($Product->getProductClasses() as $ProductClass) { + $ProductClass + ->setStockUnlimited(false) + ->setStock($faker->numberBetween(1, 999)); + } + } + $this->app['orm.em']->flush(); + + // 1商品だけ 0 に設定する $Product = $this->app['eccube.repository.product']->findOneBy(array('name' => '商品-1')); foreach ($Product->getProductClasses() as $ProductClass) { $ProductClass diff --git a/tests/Eccube/Tests/Web/Admin/IndexControllerTest.php b/tests/Eccube/Tests/Web/Admin/IndexControllerTest.php index bcb35b7170c..2ed3a61ea84 100644 --- a/tests/Eccube/Tests/Web/Admin/IndexControllerTest.php +++ b/tests/Eccube/Tests/Web/Admin/IndexControllerTest.php @@ -178,9 +178,17 @@ public function testChangePasswordWithPost() $Member = clone $this->Member; $Member->setPassword($form['change_password']['first']); - $this->expected = $this->app['eccube.repository.member']->encryptPassword($Member);; + $this->expected = $this->app['eccube.repository.member']->encryptPassword($Member); $this->actual = $this->Member->getPassword(); - $this->verify(); + + $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() + ); } public function testChangePasswordWithPostInvalid()