diff --git a/codeception/_support/Page/Admin/CategoryManagePage.php b/codeception/_support/Page/Admin/CategoryManagePage.php index e08b8ac30ba..29e08e1605b 100644 --- a/codeception/_support/Page/Admin/CategoryManagePage.php +++ b/codeception/_support/Page/Admin/CategoryManagePage.php @@ -110,6 +110,7 @@ public function 一覧_上に($rowNum) { $this->tester->dragAndDropBy("body > div > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child($rowNum)", 0, -75); $this->tester->wait(1); + return $this; } @@ -117,6 +118,7 @@ public function 一覧_下に($rowNum) { $this->tester->dragAndDropBy("body > div > div.c-contentsArea > div.c-contentsArea__cols > div.c-contentsArea__primaryCol > div > div > div > div > ul > li:nth-child($rowNum)", 0, 75); $this->tester->wait(1); + return $this; } diff --git a/codeception/acceptance/EA07BasicinfoCest.php b/codeception/acceptance/EA07BasicinfoCest.php index 13029500861..8481c26bd7f 100644 --- a/codeception/acceptance/EA07BasicinfoCest.php +++ b/codeception/acceptance/EA07BasicinfoCest.php @@ -81,7 +81,7 @@ public function basicinfo_支払方法入れ替え(AcceptanceTester $I) public function basicinfo_支払方法登録(AcceptanceTester $I) { - $I->getScenario()->skip('EA0705-UC01-T01 支払方法 登録'); + $I->getScenario()->incomplete('EA0705-UC01-T01 支払方法 登録'); $I->wantTo('EA0705-UC01-T01 支払方法 登録'); // 表示 @@ -105,7 +105,7 @@ public function basicinfo_支払方法登録(AcceptanceTester $I) public function basicinfo_支払方法編集(AcceptanceTester $I) { - $I->getScenario()->skip('EA0705-UC01-T01 支払方法 登録'); + $I->getScenario()->incomplete('EA0705-UC01-T01 支払方法 登録'); $I->wantTo('EA0705-UC02-T01 支払方法 編集'); // 表示 diff --git a/codeception/acceptance/EA08SysteminfoCest.php b/codeception/acceptance/EA08SysteminfoCest.php index 8c4aa8997a3..22645f6176e 100644 --- a/codeception/acceptance/EA08SysteminfoCest.php +++ b/codeception/acceptance/EA08SysteminfoCest.php @@ -287,7 +287,7 @@ public function systeminfo_セキュリティ管理SSL(AcceptanceTester $I) { $I->wantTo('EA0804-UC01-T04 セキュリティ管理 - SSL強制'); - $I->getScenario()->skip('このテストを通すと以降のテストが通らなくなってしまっているので一時的にスキップ'); + $I->getScenario()->incomplete('このテストを通すと以降のテストが通らなくなってしまっているので一時的にスキップ'); $httpBaseUrl = $I->getBaseUrl(); $I->amOnUrl($httpBaseUrl); diff --git a/codeception/acceptance/EF02ProductCest.php b/codeception/acceptance/EF02ProductCest.php index e21f756a269..845f34336d9 100644 --- a/codeception/acceptance/EF02ProductCest.php +++ b/codeception/acceptance/EF02ProductCest.php @@ -40,6 +40,7 @@ public function product_商品一覧初期表示(AcceptanceTester $I) public function product_商品一覧ヘッダ以外のカテゴリリンク(AcceptanceTester $I) { + $I->getScenario()->incomplete('テスト項目を要確認'); $I->wantTo('EF0201-UC01-T02 商品一覧ページ ヘッダ以外のカテゴリリンク'); $I->amOnPage('/'); diff --git a/package.json b/package.json index 7d7003521e0..1a10672bca4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eccube", - "version": "4.1-beta2", + "version": "4.1-beta3", "description": "EC-CUBE EC open platform.", "main": "index.js", "directories": { diff --git a/src/Eccube/Command/ComposerRemoveCommand.php b/src/Eccube/Command/ComposerRemoveCommand.php index 0894ad435f3..01957eb082d 100644 --- a/src/Eccube/Command/ComposerRemoveCommand.php +++ b/src/Eccube/Command/ComposerRemoveCommand.php @@ -49,6 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output) try { /* @var Command $command */ $command = $this->getApplication()->get('cache:clear'); + return $command->run(new ArrayInput([ 'command' => 'cache:clear', '--no-warmup' => true, diff --git a/src/Eccube/Common/Constant.php b/src/Eccube/Common/Constant.php index 56e28dfcde9..82de4a5fe47 100644 --- a/src/Eccube/Common/Constant.php +++ b/src/Eccube/Common/Constant.php @@ -18,7 +18,7 @@ class Constant /** * EC-CUBE VERSION. */ - const VERSION = '4.1-beta2'; + const VERSION = '4.1-beta3'; /** * Enable value. diff --git a/src/Eccube/Controller/Admin/Content/CacheController.php b/src/Eccube/Controller/Admin/Content/CacheController.php index f9425aa0edc..f0d75e3dfa7 100644 --- a/src/Eccube/Controller/Admin/Content/CacheController.php +++ b/src/Eccube/Controller/Admin/Content/CacheController.php @@ -14,6 +14,7 @@ namespace Eccube\Controller\Admin\Content; use Eccube\Controller\AbstractController; +use Eccube\Service\SystemService; use Eccube\Util\CacheUtil; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\Extension\Core\Type\FormType; @@ -26,15 +27,19 @@ class CacheController extends AbstractController * @Route("/%eccube_admin_route%/content/cache", name="admin_content_cache", methods={"GET", "POST"}) * @Template("@admin/Content/cache.twig") */ - public function index(Request $request, CacheUtil $cacheUtil) + public function index(Request $request, CacheUtil $cacheUtil, SystemService $systemService) { $builder = $this->formFactory->createBuilder(FormType::class); $form = $builder->getForm(); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { + $systemService->switchMaintenance(true); + $cacheUtil->clearCache(); + $this->addFlash('eccube.admin.disable_maintenance', ''); + $this->addSuccess('admin.common.delete_complete', 'admin'); } diff --git a/src/Eccube/Controller/Admin/Content/MaintenanceController.php b/src/Eccube/Controller/Admin/Content/MaintenanceController.php index fb0a0e1b1aa..c3575a02534 100644 --- a/src/Eccube/Controller/Admin/Content/MaintenanceController.php +++ b/src/Eccube/Controller/Admin/Content/MaintenanceController.php @@ -18,6 +18,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\Routing\Annotation\Route; class MaintenanceController extends AbstractController @@ -70,4 +71,36 @@ public function index(Request $request) 'isMaintenance' => $isMaintenance, ]; } + + /** + * メンテナンス解除 + * + * キャッシュ管理やプラグインのインストール等の操作時にajax経由で解除する + * 権限管理設定でアクセス不可になるのを避けるため、ルーティングは/admin/disable_maintenanceで設定しています + * + * @Route("/%eccube_admin_route%/disable_maintenance/{mode}", requirements={"mode": "manual|auto_maintenance|auto_maintenance_update"}, name="admin_disable_maintenance", methods={"POST"}) + */ + public function disableMaintenance(Request $request, $mode, SystemService $systemService) + { + $this->isTokenValid(); + + if (!$request->isXmlHttpRequest()) { + throw new BadRequestHttpException(); + } + + if ($mode === 'manual') { + $path = $this->container->getParameter('eccube_content_maintenance_file_path'); + if (file_exists($path)) { + unlink($this->container->getParameter('eccube_content_maintenance_file_path')); + } + } else { + $maintenanceMode = [ + 'auto_maintenance' => SystemService::AUTO_MAINTENANCE, + 'auto_maintenance_update' => SystemService::AUTO_MAINTENANCE_UPDATE + ]; + $systemService->disableMaintenance($maintenanceMode[$mode]); + } + + return $this->json(['success' => true]); + } } diff --git a/src/Eccube/Controller/Admin/Product/CsvImportController.php b/src/Eccube/Controller/Admin/Product/CsvImportController.php index 688e104a01f..092547d865d 100644 --- a/src/Eccube/Controller/Admin/Product/CsvImportController.php +++ b/src/Eccube/Controller/Admin/Product/CsvImportController.php @@ -1593,6 +1593,7 @@ private function makeProductCategory($Product, $Category, $sortNo) /** * @Route("/%eccube_admin_route%/product/csv_split", name="admin_product_csv_split", methods={"POST"}) + * * @param Request $request * * @return \Symfony\Component\HttpFoundation\JsonResponse @@ -1647,6 +1648,7 @@ public function splitCsv(Request $request) /** * @Route("/%eccube_admin_route%/product/csv_split_import", name="admin_product_csv_split_import", methods={"POST"}) + * * @param Request $request * * @return \Symfony\Component\HttpFoundation\JsonResponse diff --git a/src/Eccube/Controller/Admin/Product/ProductController.php b/src/Eccube/Controller/Admin/Product/ProductController.php index e9ad77abce3..182edf637b9 100644 --- a/src/Eccube/Controller/Admin/Product/ProductController.php +++ b/src/Eccube/Controller/Admin/Product/ProductController.php @@ -874,24 +874,6 @@ public function copy(Request $request, $id = null) return $this->redirectToRoute('admin_product'); } - /** - * @Route("/%eccube_admin_route%/product/product/{id}/display", requirements={"id" = "\d+"}, name="admin_product_product_display") - */ - public function display(Request $request, $id = null) - { - $event = new EventArgs( - [], - $request - ); - $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_PRODUCT_DISPLAY_COMPLETE, $event); - - if (!is_null($id)) { - return $this->redirectToRoute('product_detail', ['id' => $id, 'admin' => '1']); - } - - return $this->redirectToRoute('admin_product'); - } - /** * 商品CSVの出力. * diff --git a/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php b/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php index b18cc136108..08db8965389 100644 --- a/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php +++ b/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php @@ -13,25 +13,16 @@ namespace Eccube\Controller\Admin\Setting\System; -use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException; use Eccube\Controller\AbstractController; -use Eccube\Entity\Member; -use Eccube\Event\EccubeEvents; -use Eccube\Event\EventArgs; -use Eccube\Form\Type\Admin\MemberType; use Eccube\Form\Type\Admin\TwoFactorAuthType; use Eccube\Repository\MemberRepository; use Eccube\Service\TwoFactorAuthService; - -use Symfony\Component\Routing\Annotation\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class TwoFactorAuthController extends AbstractController { @@ -94,9 +85,10 @@ public function auth(Request $request) $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { if ($Member->getTwoFactorAuthKey()) { - if ($this->twoFactorAuthService->verifyCode($Member->getTwoFactorAuthKey(),$form->get('device_token')->getData())) { + if ($this->twoFactorAuthService->verifyCode($Member->getTwoFactorAuthKey(), $form->get('device_token')->getData())) { $response = new RedirectResponse($this->generateUrl('admin_homepage')); $response->headers->setCookie($this->twoFactorAuthService->createAuthedCookie($Member)); + return $response; } else { $error = trans('admin.setting.system.two_factor_auth.invalid_message__reinput'); @@ -126,6 +118,7 @@ public function set(Request $request) return $this->redirectToRoute('admin_homepage'); } $res = $this->createResponse($request); + return $res; } @@ -143,6 +136,7 @@ public function edit(Request $request) if (is_array($res) && isset($res['error'])) { $this->addError($res['error']); } + return $res; } @@ -161,8 +155,7 @@ private function createResponse(Request $request) $auth_key = $this->twoFactorAuthService->createSecret(); $builder->get('auth_key')->setData($auth_key); $form = $builder->getForm(); - } - else if ('POST' === $request->getMethod()) { + } elseif ('POST' === $request->getMethod()) { $form = $builder->getForm(); $form->handleRequest($request); $auth_key = $form->get('auth_key')->getData(); @@ -174,9 +167,10 @@ private function createResponse(Request $request) $this->addSuccess('admin.setting.system.two_factor_auth.complete_message', 'admin'); $response = new RedirectResponse($this->generateUrl('admin_homepage')); $response->headers->setCookie($this->twoFactorAuthService->createAuthedCookie($Member)); + return $response; } else { - $error = trans('admin.setting.system.two_factor_auth.invalid_message__reinput' ); + $error = trans('admin.setting.system.two_factor_auth.invalid_message__reinput'); } } else { $error = trans('admin.setting.system.two_factor_auth.invalid_message__invalid'); diff --git a/src/Eccube/Controller/Admin/Store/OwnerStoreController.php b/src/Eccube/Controller/Admin/Store/OwnerStoreController.php index 7737be3d64f..ce4afbce6d1 100644 --- a/src/Eccube/Controller/Admin/Store/OwnerStoreController.php +++ b/src/Eccube/Controller/Admin/Store/OwnerStoreController.php @@ -259,9 +259,6 @@ public function apiInstall(Request $request) // .maintenanceファイルを設置 $this->systemService->switchMaintenance(true); - // TERMINATE時のイベントを設定 - $this->systemService->disableMaintenance(SystemService::AUTO_MAINTENANCE); - $this->cacheUtil->clearCache(); $pluginCode = $request->get('pluginCode'); @@ -295,9 +292,6 @@ public function apiUninstall(Plugin $Plugin) // .maintenanceファイルを設置 $this->systemService->switchMaintenance(true); - // TERMINATE時のイベントを設定 - $this->systemService->disableMaintenance(SystemService::AUTO_MAINTENANCE); - $this->cacheUtil->clearCache(); if ($Plugin->isEnabled()) { @@ -427,9 +421,6 @@ public function apiUpdate(Request $request) { $this->isTokenValid(); - // TERMINATE時のイベントを設定 - $this->systemService->disableMaintenance(SystemService::AUTO_MAINTENANCE_UPDATE); - $this->cacheUtil->clearCache(); $pluginCode = $request->get('pluginCode'); diff --git a/src/Eccube/Controller/Admin/Store/PluginController.php b/src/Eccube/Controller/Admin/Store/PluginController.php index 9bc05399b92..660ab1e68b5 100644 --- a/src/Eccube/Controller/Admin/Store/PluginController.php +++ b/src/Eccube/Controller/Admin/Store/PluginController.php @@ -277,13 +277,8 @@ public function enable(Plugin $Plugin, CacheUtil $cacheUtil, Request $request) if (!$request->query->has('maintenance_mode')) { // プラグイン管理の有効ボタンを押したとき $this->systemService->switchMaintenance(true); // auto_maintenanceと設定されたファイルを生成 - // TERMINATE時のイベントを設定 - $this->systemService->disableMaintenance(SystemService::AUTO_MAINTENANCE); - } else { - // プラグイン管理のアップデートを実行したとき - // TERMINATE時のイベントを設定 - $this->systemService->disableMaintenance(SystemService::AUTO_MAINTENANCE_UPDATE); } + $cacheUtil->clearCache(); $log = null; @@ -318,6 +313,8 @@ public function enable(Plugin $Plugin, CacheUtil $cacheUtil, Request $request) } else { $this->addError($message, 'admin'); + $this->addFlash('eccube.admin.disable_maintenance', ''); + return $this->redirectToRoute('admin_store_plugin'); } } @@ -344,6 +341,8 @@ public function enable(Plugin $Plugin, CacheUtil $cacheUtil, Request $request) } else { $this->addSuccess(trans('admin.store.plugin.enable.complete', ['%plugin_name%' => $Plugin->getName()]), 'admin'); + $this->addFlash('eccube.admin.disable_maintenance', ''); + return $this->redirectToRoute('admin_store_plugin'); } } @@ -372,8 +371,6 @@ public function disable(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) } else { // プラグイン管理で無効ボタンを押したとき $this->systemService->switchMaintenance(true); // auto_maintenanceと設定されたファイルを生成 - // TERMINATE時のイベントを設定 - $this->systemService->disableMaintenance(SystemService::AUTO_MAINTENANCE); } $cacheUtil->clearCache(); @@ -394,6 +391,8 @@ public function disable(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) } else { $this->addError($message, 'admin'); + $this->addFlash('eccube.admin.disable_maintenance', ''); + return $this->redirectToRoute('admin_store_plugin'); } } @@ -422,6 +421,8 @@ public function disable(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) } else { $this->addSuccess(trans('admin.store.plugin.disable.complete', ['%plugin_name%' => $Plugin->getName()]), 'admin'); + $this->addFlash('eccube.admin.disable_maintenance', ''); + return $this->redirectToRoute('admin_store_plugin'); } } diff --git a/src/Eccube/Controller/Install/InstallController.php b/src/Eccube/Controller/Install/InstallController.php index f3c7aa70dd8..74718b74d2e 100644 --- a/src/Eccube/Controller/Install/InstallController.php +++ b/src/Eccube/Controller/Install/InstallController.php @@ -30,12 +30,10 @@ use Eccube\Doctrine\DBAL\Types\UTCDateTimeType; use Eccube\Doctrine\DBAL\Types\UTCDateTimeTzType; use Eccube\Doctrine\ORM\Mapping\Driver\AnnotationDriver; -use Eccube\Entity\Plugin; use Eccube\Form\Type\Install\Step1Type; use Eccube\Form\Type\Install\Step3Type; use Eccube\Form\Type\Install\Step4Type; use Eccube\Form\Type\Install\Step5Type; -use Eccube\Repository\PluginRepository; use Eccube\Security\Core\Encoder\PasswordEncoder; use Eccube\Util\CacheUtil; use Eccube\Util\StringUtil; @@ -509,7 +507,7 @@ public function complete(Request $request) return [ 'admin_url' => $adminUrl, 'is_sqlite' => strpos($databaseUrl, 'sqlite') !== false, - 'token' => $token + 'token' => $token, ]; } diff --git a/src/Eccube/Controller/InstallPluginController.php b/src/Eccube/Controller/InstallPluginController.php index 6ce0fc44257..05a404663d9 100644 --- a/src/Eccube/Controller/InstallPluginController.php +++ b/src/Eccube/Controller/InstallPluginController.php @@ -110,9 +110,11 @@ public function pluginEnable(Request $request, SystemService $systemService, Plu if ($Plugin->isEnabled()) { $pluginService->disable($Plugin); } else { + if (!$Plugin->isInitialized()) { + $pluginService->installWithCode($Plugin->getCode()); + } $pluginService->enable($Plugin); } - } finally { $log = ob_get_clean(); while (ob_get_level() > 0) { @@ -121,6 +123,7 @@ public function pluginEnable(Request $request, SystemService $systemService, Plu } $this->cacheUtil->clearCache(); + return $this->json(['success' => true, 'log' => $log]); } else { return $this->json(['success' => false, 'log' => $log]); diff --git a/src/Eccube/Controller/SitemapController.php b/src/Eccube/Controller/SitemapController.php index 27d1221c4ab..9bfe124c8a7 100644 --- a/src/Eccube/Controller/SitemapController.php +++ b/src/Eccube/Controller/SitemapController.php @@ -176,6 +176,7 @@ public function page() if (is_null($route)) { return false; } + return count($route->compile()->getPathVariables()) < 1; }); diff --git a/src/Eccube/EventListener/MaintenanceListener.php b/src/Eccube/EventListener/MaintenanceListener.php index 07554ef997a..235d147dcb1 100644 --- a/src/Eccube/EventListener/MaintenanceListener.php +++ b/src/Eccube/EventListener/MaintenanceListener.php @@ -23,7 +23,6 @@ class MaintenanceListener implements EventSubscriberInterface { - /** @var Context */ protected $requestContext; @@ -49,6 +48,7 @@ public function onResponse(FilterResponseEvent $event) if (!$this->systemService->isMaintenanceMode()) { $response->headers->clearCookie(SystemService::MAINTENANCE_TOKEN_KEY); + return; } diff --git a/src/Eccube/EventListener/TwoFactorAuthListener.php b/src/Eccube/EventListener/TwoFactorAuthListener.php index 5d1887694fc..1788cbf5356 100644 --- a/src/Eccube/EventListener/TwoFactorAuthListener.php +++ b/src/Eccube/EventListener/TwoFactorAuthListener.php @@ -14,22 +14,21 @@ namespace Eccube\EventListener; use Eccube\Common\EccubeConfig; -use Eccube\Request\Context; use Eccube\Entity\Member; +use Eccube\Request\Context; use Eccube\Service\TwoFactorAuthService; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpKernel\Event\FilterControllerEvent; +use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class TwoFactorAuthListener implements EventSubscriberInterface { /** * @var array 2段階認証のチェックを除外するroute */ - const ROUTE_EXCLUDE = ['admin_two_factor_auth','admin_two_factor_auth_set']; + const ROUTE_EXCLUDE = ['admin_two_factor_auth', 'admin_two_factor_auth_set']; /** * @var EccubeConfig @@ -58,11 +57,11 @@ class TwoFactorAuthListener implements EventSubscriberInterface * @param EncoderFactoryInterface $encoderFactory */ public function __construct( - EccubeConfig $eccubeConfig, + EccubeConfig $eccubeConfig, Context $requestContext, UrlGeneratorInterface $router, TwoFactorAuthService $twoFactorAuthService - ){ + ) { $this->eccubeConfig = $eccubeConfig; $this->requestContext = $requestContext; $this->router = $router; @@ -87,7 +86,7 @@ public function onKernelController(FilterControllerEvent $event) } $route = $event->getRequest()->attributes->get('_route'); - if (in_array($route,self::ROUTE_EXCLUDE)) { + if (in_array($route, self::ROUTE_EXCLUDE)) { return; } @@ -99,15 +98,15 @@ public function onKernelController(FilterControllerEvent $event) ) { // トークン入力 if ($Member->getTwoFactorAuthKey()) { - $url = $this->router->generate("admin_two_factor_auth", [], UrlGeneratorInterface::ABSOLUTE_PATH); + $url = $this->router->generate('admin_two_factor_auth', [], UrlGeneratorInterface::ABSOLUTE_PATH); } // 2段階認証設定 else { - $url = $this->router->generate("admin_two_factor_auth_set", [], UrlGeneratorInterface::ABSOLUTE_PATH); + $url = $this->router->generate('admin_two_factor_auth_set', [], UrlGeneratorInterface::ABSOLUTE_PATH); } - $event->setController(function() use ($url) { - return new RedirectResponse($url, $status=302); + $event->setController(function () use ($url) { + return new RedirectResponse($url, $status = 302); }); } } diff --git a/src/Eccube/Form/EventListener/HTMLPurifierListener.php b/src/Eccube/Form/EventListener/HTMLPurifierListener.php index 9d6a5bfede3..81580208cc6 100644 --- a/src/Eccube/Form/EventListener/HTMLPurifierListener.php +++ b/src/Eccube/Form/EventListener/HTMLPurifierListener.php @@ -13,7 +13,6 @@ namespace Eccube\Form\EventListener; - use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; diff --git a/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php b/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php index d6cad09c8a7..c77f4f21e15 100644 --- a/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php +++ b/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php @@ -13,7 +13,6 @@ namespace Eccube\Form\Extension; - use Eccube\Form\EventListener\HTMLPurifierListener; use Eccube\Request\Context; use Symfony\Component\Form\AbstractTypeExtension; diff --git a/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php b/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php index 9edbc1c7a44..88d2df8b1ae 100644 --- a/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php +++ b/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php @@ -14,10 +14,10 @@ namespace Eccube\Form\Type\Admin; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints as Assert; -use Symfony\Component\Form\Extension\Core\Type\TextType; -use Symfony\Component\Form\Extension\Core\Type\HiddenType; class TwoFactorAuthType extends AbstractType { @@ -40,7 +40,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ], 'attr' => [ 'maxlength' => 6, - 'style' => 'width: 100px;' + 'style' => 'width: 100px;', ], ]) ->add( diff --git a/src/Eccube/Resource/template/admin/Content/cache.twig b/src/Eccube/Resource/template/admin/Content/cache.twig index 8d4c73717dd..f913f319a60 100644 --- a/src/Eccube/Resource/template/admin/Content/cache.twig +++ b/src/Eccube/Resource/template/admin/Content/cache.twig @@ -15,6 +15,17 @@ file that was distributed with this source code. {% block title %}{{ 'admin.content.cache_management'|trans }}{% endblock %} {% block sub_title %}{{ 'admin.content.contents_management'|trans }}{% endblock %} +{% block javascript %} +{% if app.flashes('eccube.admin.disable_maintenance') %} + +{% endif %} +{% endblock %} + {% form_theme form '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %} {% block main %} diff --git a/src/Eccube/Resource/template/admin/Store/plugin_confirm.twig b/src/Eccube/Resource/template/admin/Store/plugin_confirm.twig index 600b386d1bc..4512d2e62c7 100644 --- a/src/Eccube/Resource/template/admin/Store/plugin_confirm.twig +++ b/src/Eccube/Resource/template/admin/Store/plugin_confirm.twig @@ -42,6 +42,9 @@ $(function() { ctx.progressBar.css('width', ((ctx.currentCount/ctx.totalCount + 0.5/ctx.totalCount)*100) + '%'); ctx.log(data.log); }) + }).then(function() { + // メンテナンスモード解除 + return $.post("{{ url('admin_disable_maintenance', { 'mode': 'auto_maintenance' }) }}", ctx.plugin); }); } }, @@ -81,6 +84,9 @@ $(function() { ctx.progressBar.css('width', '80%'); ctx.log(data.log); }) + }).then(function() { + // メンテナンスモード解除 + return $.post("{{ url('admin_disable_maintenance', { 'mode': 'auto_maintenance_update' }) }}", ctx.plugin); }); } } diff --git a/src/Eccube/Resource/template/admin/Store/plugin_table_official.twig b/src/Eccube/Resource/template/admin/Store/plugin_table_official.twig index 095f1a138be..6fe61d9532c 100644 --- a/src/Eccube/Resource/template/admin/Store/plugin_table_official.twig +++ b/src/Eccube/Resource/template/admin/Store/plugin_table_official.twig @@ -22,11 +22,13 @@ $(function() { var progress = $('div.progress', modal).show(); $.ajax({url: currentPlugin['deleteUrl'], type: 'delete'}).then( function(data) { - message.text('削除が完了しました。'); - $('#deleteLog').text(data.log); - $('#deleteLogPane').show(); - progress.hide(); - footer.show().find('button').toggle(); + $.post("{{ url('admin_disable_maintenance', { 'mode': 'auto_maintenance' }) }}").then(function() { + message.text('削除が完了しました。'); + $('#deleteLog').text(data.log); + $('#deleteLogPane').show(); + progress.hide(); + footer.show().find('button').toggle(); + }); }, function(res) { if (res.responseJSON.message) { @@ -37,12 +39,17 @@ $(function() { if (res.responseJSON.log) { $('#deleteLog').text(res.responseJSON.log); } - progress.hide(); $('#deleteLogPane').show(); + progress.hide(); footer.show().find('button').toggle(); } ); }); + + {% if app.flashes('eccube.admin.disable_maintenance') %} + // メンテナンスモード解除 + $.post("{{ url('admin_disable_maintenance', { 'mode': 'auto_maintenance' }) }}"); + {% endif %} }); {% if Plugins|length > 0 %} diff --git a/src/Eccube/Service/SystemService.php b/src/Eccube/Service/SystemService.php index 33c2205b95e..e97f1589dd2 100644 --- a/src/Eccube/Service/SystemService.php +++ b/src/Eccube/Service/SystemService.php @@ -15,15 +15,15 @@ use Doctrine\ORM\EntityManagerInterface; use Eccube\Util\StringUtil; +use function explode; +use function file_exists; +use function file_get_contents; +use function file_put_contents; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector; use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; -use function explode; -use function file_exists; -use function file_get_contents; -use function file_put_contents; use function unlink; class SystemService implements EventSubscriberInterface @@ -166,6 +166,7 @@ public function getMaintenanceToken(): ?string } $contents = file_get_contents($path); + return explode(':', $contents)[1] ?? null; } diff --git a/src/Eccube/Service/TwoFactorAuthService.php b/src/Eccube/Service/TwoFactorAuthService.php index dd08e422259..ba567e1b32d 100644 --- a/src/Eccube/Service/TwoFactorAuthService.php +++ b/src/Eccube/Service/TwoFactorAuthService.php @@ -16,12 +16,12 @@ use Eccube\Common\EccubeConfig; use RobThree\Auth\TwoFactorAuth; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; -use Symfony\Component\HttpFoundation\Cookie; -class TwoFactorAuthService +class TwoFactorAuthService { /** * @var int デフォルトの認証の有効日数 @@ -111,38 +111,40 @@ public function __construct( /** * @param Eccube\Entity\Member + * * @return boolean */ public function isAuth($Member) { - if (($json = $this->request->cookies->get($this->cookieName))) { $configs = json_decode($json); - $encodedString = $this->encoder->encodePassword($Member->getId() . $Member->getTwoFactorAuthKey(), $Member->getSalt()); + $encodedString = $this->encoder->encodePassword($Member->getId().$Member->getTwoFactorAuthKey(), $Member->getSalt()); if ( $configs && isset($configs->{$Member->getId()}) && ($config = $configs->{$Member->getId()}) - && property_exists($config,'key') + && property_exists($config, 'key') && $config->key === $encodedString && ( $this->expire == 0 - || (property_exists($config,'date') && ($config->date && $config->date > date('U', strtotime('-' . $this->expire . ' day')))) + || (property_exists($config, 'date') && ($config->date && $config->date > date('U', strtotime('-'.$this->expire.' day')))) ) ) { return true; } } + return false; } /** * @param Eccube\Entity\Member + * * @return Cookie */ public function createAuthedCookie($Member) { - $encodedString = $this->encoder->encodePassword($Member->getId() . $Member->getTwoFactorAuthKey(), $Member->getSalt()); + $encodedString = $this->encoder->encodePassword($Member->getId().$Member->getTwoFactorAuthKey(), $Member->getSalt()); $configs = json_decode('{}'); if (($json = $this->request->cookies->get($this->cookieName))) { @@ -157,7 +159,7 @@ public function createAuthedCookie($Member) $this->cookieName, // name json_encode($configs), // value ($this->expire == 0 ? 0 : time() + ($this->expire * 24 * 60 * 60)), // expire - '/' . $this->eccubeConfig->get('eccube_admin_route'), // path + '/'.$this->eccubeConfig->get('eccube_admin_route'), // path null, // domain ($this->eccubeConfig->get('eccube_force_ssl') ? true : false), // secure true, // httpOnly @@ -166,16 +168,17 @@ public function createAuthedCookie($Member) ); return $cookie; - } + } /** * @param Eccube\Entity\Member - * @param string + * @param string + * * @return boolean */ - public function verifyCode($authKey,$token) + public function verifyCode($authKey, $token) { - return $this->tfa->verifyCode($authKey,$token,2); + return $this->tfa->verifyCode($authKey, $token, 2); } /** @@ -189,11 +192,13 @@ public function createSecret() /** * @return bool */ - public function isEnabled() { + public function isEnabled() + { $enabled = $this->eccubeConfig->get('eccube_2fa_enabled'); if (is_string($enabled) && $enabled === 'false' || $enabled === false) { return false; } + return true; } } diff --git a/tests/Eccube/Tests/Command/PluginDevelopEntityFromDbTest.php b/tests/Eccube/Tests/Command/PluginDevelopEntityFromDbTest.php deleted file mode 100644 index d806cd2060c..00000000000 --- a/tests/Eccube/Tests/Command/PluginDevelopEntityFromDbTest.php +++ /dev/null @@ -1,385 +0,0 @@ -markTestIncomplete(get_class($this).' は未実装です'); - parent::setUp(); - - $this->markTestIncomplete(); - - $this->initCommand(new PluginCommand()); - } - - public function testFirst() - { - // TODO question helperのunit testの実装方法を変更 - // http://symfony.com/doc/current/components/console/helpers/questionhelper.html - $this->markTestSkipped(); - - $code = 'PluginUnittestSample'; - - $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$code; - $this->removePluginDir($codePath); - $this->createPluginDir($codePath); - - $this->dropTable($code); - $this->createTable($code); - $tableName = 'plg_'.strtolower($code); - - $testCase = [ - //プラグイン名 - 'entity' => [ - [ - 'input' => 'd', - ], - ], - //プラグインコード - 1 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'テストプラグイン名', - 'output' => 'Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)', - ], - [ - 'input' => strtolower($code), - 'output' => 'Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)', - ], - [ - 'input' => $code, - 'output' => 'Table name:', - ], - ], - //Table name: - 2 => [ - [ - 'input' => 'plg_', - 'output' => [ - 'No results have been found', - $tableName, - ], - ], - [ - 'input' => $tableName, - 'output' => [ - 'your entry list', - $tableName, - ], - ], - [ - 'input' => '', - ], - ], - //supportFlag - 3 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'a', - 'output' => 'No results have been found', - ], - [ - 'input' => 'y', - ], - ], - //確認 - 'confirm' => [ - [ - 'output' => [ - $tableName, - ], - ], - [ - 'input' => 'y', - ], - ], - ]; - $this->setTestCase($testCase); - - $commandArg = [ - 'command' => 'plugin:develop', - 'mode' => 'entity', - '--no-ansi' => true, - ]; - - $this->executeTester([$this, 'checkQuestion'], $commandArg); - - //ファイルとフォルダー作成確認 - $ff = [ - $codePath, - $codePath.'/Entity', - $codePath.'/Entity/'.ucfirst(strtolower($code)).'.php', - $codePath.'/Repository', - $codePath.'/Repository/'.ucfirst(strtolower($code)).'Repository.php', - $codePath.'/Resource', - $codePath.'/Resource/doctrine', - $codePath.'/Resource/doctrine/Plugin.'.$code.'.Entity.'.ucfirst(strtolower($code)).'.dcm.yml', - $codePath.'/Resource/doctrine/migration', - ]; - - $this->checkFileAndFolder($ff); - $this->removePluginDir($codePath); - $this->removePluginDb($code); - } - - public function checkQuestion($text, Question $question) - { - $output = $this->getLastContent(); - foreach ($this->testCase as $no => $row) { - if (is_numeric($no)) { - $searchStr = $this->getQuestionMark($no); - } else { - $searchStr = $no; - } - if (strpos($text, $searchStr) !== false) { - foreach ($row as $subNo => $case) { - $ret = null; - if (isset($case['input'])) { - $ret = $case['input']; - unset($this->testCase[$no][$subNo]['input']); - } elseif (isset($case['output'])) { - if (is_array($case['output'])) { - $checkOutput = $case['output']; - } else { - $checkOutput = [$case['output']]; - } - foreach ($checkOutput as $node) { - $this->assertInOutput($output, $node); - } - unset($this->testCase[$no][$subNo]['output']); - } - if ($ret !== null) { - return $ret; - } - continue; - } - } - } - - throw new \Exception('Test case not set.'.PHP_EOL.' output='.$output); - } - - protected function assertInOutput($output, $msg) - { - if (strpos($output, $msg) !== false) { - $this->assertTrue(true); - - return true; - } - $error = 'Input string not found in output.'.PHP_EOL.' search='.$msg.PHP_EOL.' output='.$output.''.PHP_EOL; - $this->assertTrue(false, $error); - - return false; - } - - protected function setTestCase($testCase) - { - $this->testCase = $testCase; - } - - protected function removePluginDir($pluginPath) - { - if (!empty($pluginPath) && file_exists($pluginPath)) { - $fs = new Filesystem(); - $fs->remove($pluginPath); - } - } - - protected function createPluginDir($codePath) - { - if (!is_dir($codePath)) { - mkdir($codePath); - } - } - - protected function removePluginDb($code) - { - /* @var $entityManager \Doctrine\ORM\EntityManager */ - $entityManager = $this->app['orm.em']; - - $entityManager->clear(); - $pluginList = $entityManager->getRepository('\Eccube\\Entity\Plugin')->findBy(['code' => $code]); - if ($pluginList) { - foreach ($pluginList as $plugin) { - $entityManager->remove($plugin); - } - $entityManager->flush(); - } - } - - protected function checkFileAndFolder($ff) - { - foreach ($ff as $path) { - $msg = 'fail assert that a file/path exists.('.$path.')'; - $this->assertTrue(file_exists($path), $msg); - } - } - - private function dropTable($code) - { - $tableName = 'plg_'.strtolower($code); - - /* @var $entityManager \Doctrine\ORM\EntityManager */ - $entityManager = $this->app['orm.em']; - /* @var $schema \Doctrine\DBAL\Schema\Schema */ - $schema = $entityManager->getConnection()->getSchemaManager()->createSchema(); - $dbName = $schema->getName(); - $tableNames = array_flip($schema->getTableNames()); - - if (!isset($tableNames[$dbName.'.'.$tableName])) { - return; - } - - $toSchema = clone $schema; - - $toSchema->dropTable($tableName); - $platform = $entityManager->getConnection()->getDatabasePlatform(); - $queries = $schema->getMigrateToSql($toSchema, $platform); - - if (is_array($queries)) { - foreach ($queries as $query) { - $entityManager->getConnection()->executeQuery($query); - } - } - } - - private function createTable($code) - { - $schema = new \Doctrine\DBAL\Schema\Schema(); - $table = $schema->createTable('plg_'.strtolower($code)); - $table->addColumn('id', 'integer', [ - 'notnull' => true, - 'unsigned' => true, - 'autoincrement' => true, - 'comment' => '問合せID', - ]); - $table->addColumn('contact_type', 'integer', [ - 'notnull' => true, - 'comment' => '問合せ種別', - ]); - $table->addColumn('contents', 'string', [ - 'notnull' => true, - 'comment' => '問合せ内容', - 'length' => '4096', - ]); - $table->addColumn('customer_id', 'integer', [ - 'notnull' => false, - 'unsigned' => true, - 'comment' => 'M顧客ID', - ]); - $table->addColumn('name_sei', 'string', [ - 'notnull' => true, - 'comment' => '名前(姓)', - 'length' => '64', - ]); - $table->addColumn('name_mei', 'string', [ - 'notnull' => true, - 'comment' => '名前(名)', - 'length' => '64', - ]); - $table->addColumn('kana_sei', 'string', [ - 'notnull' => true, - 'comment' => 'カナ(姓)', - 'length' => '64', - ]); - $table->addColumn('kana_mei', 'string', [ - 'notnull' => true, - 'comment' => 'カナ(名)', - 'length' => '64', - ]); - $table->addColumn('email', 'string', [ - 'notnull' => true, - 'comment' => 'メールアドレス', - 'length' => '256', - ]); - $table->addColumn('phone', 'string', [ - 'notnull' => true, - 'comment' => '電話番号', - 'length' => '16', - ]); - $table->addColumn('postal_code', 'string', [ - 'notnull' => false, - 'comment' => '郵便番号', - 'length' => '8', - ]); - $table->addColumn('pref_id', 'integer', [ - 'notnull' => false, - 'comment' => '都道府県ID', - ]); - $table->addColumn('addr01', 'string', [ - 'notnull' => false, - 'comment' => '住所01', - 'length' => '128', - ]); - $table->addColumn('addr02', 'string', [ - 'notnull' => false, - 'comment' => '住所02', - 'length' => '128', - ]); - $table->addColumn('note', 'string', [ - 'notnull' => false, - 'comment' => '備考', - 'length' => '1024', - ]); - $table->addColumn('process_status', 'integer', [ - 'notnull' => true, - 'comment' => '対応状況(ステータス)', - ]); - $table->addColumn('create_datetime', 'datetime', [ - 'notnull' => true, - 'default' => '2000-01-01 00:00:00', - 'comment' => '作成日付', - ]); - $table->addColumn('update_datetime', 'datetime', [ - 'notnull' => false, - 'comment' => '更新日付', - ]); - - $table->setPrimaryKey(['id']); - /* @var $entityManager \Doctrine\ORM\EntityManager */ - $entityManager = $this->app['orm.em']; - $platform = $entityManager->getConnection()->getDatabasePlatform(); - $queries = $schema->toSql($platform); - - if (is_array($queries)) { - foreach ($queries as $query) { - $entityManager->getConnection()->executeQuery($query); - } - } - } - - public function tearDown() - { - $this->app->initDoctrine(); - } -} diff --git a/tests/Eccube/Tests/Command/PluginDevelopEntityFromYamlTest.php b/tests/Eccube/Tests/Command/PluginDevelopEntityFromYamlTest.php deleted file mode 100644 index 1103bb98949..00000000000 --- a/tests/Eccube/Tests/Command/PluginDevelopEntityFromYamlTest.php +++ /dev/null @@ -1,319 +0,0 @@ -markTestIncomplete(get_class($this).' は未実装です'); - parent::setUp(); - - $this->markTestIncomplete(); - - if ($this->app['config']['database']['driver'] == 'pdo_sqlite') { - $this->markTestSkipped('Can not support for sqlite3'); - } - - $this->initCommand(new PluginCommand()); - } - - public function testFirst() - { - // TODO question helperのunit testの実装方法を変更 - // http://symfony.com/doc/current/components/console/helpers/questionhelper.html - $this->markTestSkipped(); - - $code = 'PluginUnittestSample'; - - $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$code; - $this->removePluginDir($codePath); - $this->createPluginDir($codePath, $code); - - $yamlName = 'Plugin.'.$code.'.Entity.'.ucfirst(strtolower($code)).'.dcm.yml'; - - $testCase = [ - //プラグイン名 - 'entity' => [ - [ - 'input' => 'y', - ], - ], - //プラグインコード - 1 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'テストプラグイン名', - 'output' => 'Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)', - ], - [ - 'input' => strtolower($code), - 'output' => 'Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)', - ], - [ - 'input' => $code, - 'output' => 'Table name:', - ], - ], - //Table name: - 2 => [ - [ - 'input' => $code, - 'output' => [ - 'No results have been found', - $yamlName, - ], - ], - [ - 'input' => $yamlName, - 'output' => [ - 'your entry list', - $yamlName, - ], - ], - [ - 'input' => '', - ], - ], - //supportFlag - 3 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'a', - 'output' => 'No results have been found', - ], - [ - 'input' => 'y', - ], - ], - //確認 - 'confirm' => [ - [ - 'output' => [ - $yamlName, - ], - ], - [ - 'input' => 'y', - ], - ], - ]; - $this->setTestCase($testCase); - - $commandArg = [ - 'command' => 'plugin:develop', - 'mode' => 'entity', - '--no-ansi' => true, - ]; - - $this->executeTester([$this, 'checkQuestion'], $commandArg); - - //ファイルとフォルダー作成確認 - $ff = [ - $codePath, - $codePath.'/Entity', - $codePath.'/Entity/'.ucfirst(strtolower($code)).'.php', - $codePath.'/Repository', - $codePath.'/Repository/'.ucfirst(strtolower($code)).'Repository.php', - $codePath.'/Resource', - $codePath.'/Resource/doctrine', - $codePath.'/Resource/doctrine/Plugin.'.$code.'.Entity.'.ucfirst(strtolower($code)).'.dcm.yml', - $codePath.'/Resource/doctrine/migration', - ]; - $this->checkFileAndFolder($ff); - $this->removePluginDir($codePath); - } - - public function checkQuestion($text, Question $question) - { - $output = $this->getLastContent(); - foreach ($this->testCase as $no => $row) { - if (is_numeric($no)) { - $searchStr = $this->getQuestionMark($no); - } else { - $searchStr = $no; - } - if (strpos($text, $searchStr) !== false) { - foreach ($row as $subNo => $case) { - $ret = null; - if (isset($case['input'])) { - $ret = $case['input']; - unset($this->testCase[$no][$subNo]['input']); - } elseif (isset($case['output'])) { - if (is_array($case['output'])) { - $checkOutput = $case['output']; - } else { - $checkOutput = [$case['output']]; - } - foreach ($checkOutput as $node) { - $this->assertInOutput($output, $node); - } - unset($this->testCase[$no][$subNo]['output']); - } - if ($ret !== null) { - return $ret; - } - continue; - } - } - } - - throw new \Exception('Test case not set.'.PHP_EOL.' output='.$output); - } - - protected function assertInOutput($output, $msg) - { - if (strpos($output, $msg) !== false) { - $this->assertTrue(true); - - return true; - } - $error = 'Input string not found in output.'.PHP_EOL.' search='.$msg.PHP_EOL.' output='.$output.''.PHP_EOL; - $this->assertTrue(false, $error); - - return false; - } - - protected function setTestCase($testCase) - { - $this->testCase = $testCase; - } - - protected function removePluginDir($pluginPath) - { - if (!empty($pluginPath) && file_exists($pluginPath)) { - $fs = new Filesystem(); - $fs->remove($pluginPath); - } - } - - protected function createPluginDir($codePath, $code) - { - if (!is_dir($codePath)) { - mkdir($codePath); - } - - $codePath .= '/Resource'; - if (!is_dir($codePath)) { - mkdir($codePath); - } - $codePath .= '/doctrine'; - if (!is_dir($codePath)) { - mkdir($codePath); - } - $yamlPath = $codePath.'/Plugin.'.$code.'.Entity.'.ucfirst(strtolower($code)).'.dcm.yml'; - if (!is_file($yamlPath)) { - } - if (!is_file($yamlPath)) { - $body = $this->createYamlBody($code); - file_put_contents($yamlPath, $body); - } - } - - protected function checkFileAndFolder($ff) - { - foreach ($ff as $path) { - $msg = 'fail assert that a file/path exists.('.$path.')'; - $this->assertTrue(file_exists($path), $msg); - } - } - - private function createYamlBody($code) - { - $body = 'Plugin\\'.$code."\Entity\\".ucfirst(strtolower($code)).': - type: entity - table: plg_'.strtolower($code).' - repositoryClass: Plugin\\'.$code."\Repository\\".ucfirst(strtolower($code))."Repository - id: - id: - type: integer - nullable: false - unsigned: true - id: true - column: id - generator: - strategy: AUTO - fields: - contact_type: - type: integer - nullable: false - contents: - type: string - nullable: false - customer_id: - type: integer - nullable: true - unsigned: true - name_sei: - type: string - nullable: false - name_mei: - type: string - nullable: false - kana_sei: - type: string - nullable: false - kana_mei: - type: string - nullable: false - email: - type: string - nullable: false - phone: - type: string - nullable: false - postal_code: - type: string - nullable: true - pref_id: - type: integer - nullable: true - addr01: - type: string - nullable: true - addr02: - type: string - nullable: true - note: - type: string - nullable: true - process_status: - type: integer - nullable: false - create_datetime: - type: datetime - nullable: false - options: - default: '2000-01-01 00:00:00' - update_datetime: - type: datetime - nullable: true - lifecycleCallbacks: { } - "; - - return $body; - } -} diff --git a/tests/Eccube/Tests/Command/PluginDevelopGenerateTest.php b/tests/Eccube/Tests/Command/PluginDevelopGenerateTest.php deleted file mode 100644 index 65992ac8b93..00000000000 --- a/tests/Eccube/Tests/Command/PluginDevelopGenerateTest.php +++ /dev/null @@ -1,352 +0,0 @@ -markTestIncomplete(get_class($this).' は未実装です'); - parent::setUp(); - - $this->markTestIncomplete(); - - if ($this->app['config']['database']['driver'] == 'pdo_sqlite') { - $this->markTestSkipped('Can not support for sqlite3'); - } - - $this->initCommand(new PluginCommand()); - } - - public function testFirst() - { - // TODO question helperのunit testの実装方法を変更 - // http://symfony.com/doc/current/components/console/helpers/questionhelper.html - $this->markTestSkipped(); - - $code = 'PluginUnittestSample'; - - $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$code; - $this->removePluginDir($codePath); - $this->removePluginDb($code); - - $testCase = [ - //プラグイン名 - 1 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'Plugin Name', - 'output' => 'Plugin Code:', - ], - ], - //プラグインコード - 2 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'Plugin Code', - 'output' => 'Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)', - ], - [ - 'input' => strtolower($code), - 'output' => 'Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.', - ], - [ - 'input' => $code, - 'output' => 'Version:', - ], - ], - //バージョン - 3 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'ひらがな', - 'output' => 'correct format is x.y.z', - ], - [ - 'input' => 'alphabet', - 'output' => 'correct format is x.y.z', - ], - [ - 'input' => '1.0.0', - 'output' => 'Author:', - ], - ], - //バージョン - 4 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'Author Name', - 'output' => 'Old version support:', - ], - ], - //サーポットバージョン - 5 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'a', - 'output' => 'No results have been found', - ], - [ - 'input' => 'y', - 'output' => 'Site events:', - ], - ], - //サイト共通イベント - 6 => [ - [ - 'input' => 'entry', - 'output' => [ - 'there are more then one search result', - 'eccube.event.render.entry.before', - ], - ], - [ - 'input' => 'eccube.event.render.entry.before', - 'output' => [ - 'your entry list', - 'eccube.event.render.entry.before', - ], - ], - [ - 'input' => 'product_list', - 'output' => [ - 'there are more then one search result', - 'eccube.event.render.product_list.before', - ], - ], - [ - 'input' => 'eccube.event.render.product_list.before', - 'output' => [ - 'your entry list', - 'eccube.event.render.product_list.before', - ], - ], - [ - 'input' => '', - ], - ], - //フックポイント - 7 => [ - [ - 'input' => 'entry', - 'output' => [ - 'No results have been found', - 'front.entry.index.initialize', - ], - ], - [ - 'input' => 'front.entry.index.initialize', - 'output' => [ - 'your entry list', - 'front.entry.index.initialize', - ], - ], - [ - 'input' => 'change_password', - 'output' => [ - 'No results have been found', - 'admin.admin.change_password.complete', - ], - ], - [ - 'input' => 'admin.admin.change_password.complete', - 'output' => [ - 'your entry list', - 'admin.admin.change_password.complete', - ], - ], - [ - 'input' => '', - ], - ], - //orm.path - 8 => [ - [ - 'input' => '', - 'output' => 'Value cannot be empty', - ], - [ - 'input' => 'a', - 'output' => 'No results have been found', - ], - [ - 'input' => 'y', - 'output' => 'Use orm.path:', - ], - ], - //確認 - 'confirm' => [ - [ - 'output' => [ - 'Plugin Name', - $code, - '1.0.0', - 'Author Name', - 'Yes', - 'eccube.event.render.entry.before', - 'eccube.event.render.product_list.before', - 'front.entry.index.initialize', - 'admin.admin.change_password.complete', - 'Yes', - ], - ], - [ - 'input' => 'y', - 'output' => '', - ], - ], - ]; - $this->setTestCase($testCase); - - $commandArg = [ - 'command' => 'plugin:develop', - 'mode' => 'generate', - '--no-ansi' => true, - ]; - - $this->executeTester([$this, 'checkQuestion'], $commandArg); - - //ファイルとフォルダー作成確認 - $ff = [ - $codePath, - $codePath.'/ServiceProvider', - $codePath.'/ServiceProvider/'.$code.'ServiceProvider.php', - $codePath.'/Controller', - $codePath.'/Form/Type', - $codePath.'/Resource/template/admin', - $codePath.'/config.yml', - $codePath.'/PluginManager.php', - $codePath.'/Controller/ConfigController.php', - $codePath.'/Controller/'.$code.'Controller.php', - $codePath.'/Form/Type/'.$code.'ConfigType.php', - $codePath.'/Resource/template/admin/config.twig', - $codePath.'/Resource/template/index.twig', - $codePath.'/event.yml', - $codePath.'/'.$code.'Event.php', - $codePath.'/LICENSE', - ]; - - $this->checkFileAndFolder($ff); - - $this->removePluginDir($codePath); - $this->removePluginDb($code); - } - - public function checkQuestion($text, Question $question) - { - $output = $this->getLastContent(); - foreach ($this->testCase as $no => $row) { - if (is_numeric($no)) { - $searchStr = $this->getQuestionMark($no); - } else { - $searchStr = $no; - } - if (strpos($text, $searchStr) !== false) { - foreach ($row as $subNo => $case) { - $ret = null; - if (isset($case['input'])) { - $ret = $case['input']; - unset($this->testCase[$no][$subNo]['input']); - } elseif (isset($case['output'])) { - if (is_array($case['output'])) { - $checkOutput = $case['output']; - } else { - $checkOutput = [$case['output']]; - } - foreach ($checkOutput as $node) { - $this->assertInOutput($output, $node); - } - unset($this->testCase[$no][$subNo]['output']); - } - if ($ret !== null) { - return $ret; - } - continue; - } - } - } - - throw new \Exception('Test case not set.'.PHP_EOL.' output='.$output); - } - - protected function assertInOutput($output, $msg) - { - if (strpos($output, $msg) !== false) { - $this->assertTrue(true); - - return true; - } - $error = 'Input string not found in output.'.PHP_EOL.' search='.$msg.PHP_EOL.' output='.$output.''.PHP_EOL; - $this->assertTrue(false, $error); - - return false; - } - - protected function setTestCase($testCase) - { - $this->testCase = $testCase; - } - - protected function removePluginDir($pluginPath) - { - if (!empty($pluginPath) && file_exists($pluginPath)) { - $fs = new Filesystem(); - $fs->remove($pluginPath); - } - } - - protected function removePluginDb($code) - { - /* @var $entityManager \Doctrine\ORM\EntityManager */ - $entityManager = $this->app['orm.em']; - - $entityManager->clear(); - $pluginList = $entityManager->getRepository('\Eccube\\Entity\Plugin')->findBy(['code' => $code]); - if ($pluginList) { - foreach ($pluginList as $plugin) { - $entityManager->remove($plugin); - } - $entityManager->flush(); - } - } - - protected function checkFileAndFolder($ff) - { - foreach ($ff as $path) { - $msg = 'fail assert that a file/path exists.('.$path.')'; - $this->assertTrue(file_exists($path), $msg); - } - } -} diff --git a/tests/Eccube/Tests/Command/QuestionHelperMock.php b/tests/Eccube/Tests/Command/QuestionHelperMock.php deleted file mode 100644 index 12e57ba0049..00000000000 --- a/tests/Eccube/Tests/Command/QuestionHelperMock.php +++ /dev/null @@ -1,64 +0,0 @@ -markTestIncomplete(get_class($this).' は未実装です'); - parent::setUp(); - } - - /** - * @var callable - */ - private $mockHandler; - - /** - * @param callable - */ - public function setMockHandler($mockHandler) - { - $this->mockHandler = $mockHandler; - } - - /** - * @param OutputInterface - * @param Question - */ - public function doAsk(OutputInterface $output, Question $question) - { - $this->writePrompt($output, $question); - $output->write(' => '); - - $response = call_user_func($this->mockHandler, $question->getQuestion(), $question); - - if (strlen($response) <= 0) { - $response = $question->getDefault(); - } - - if ($normalizer = $question->getNormalizer()) { - $response = $normalizer($response); - } - - $output->writeln(print_r($response, true)); - - return $response; - } -} diff --git a/tests/Eccube/Tests/EventListener/ForwardOnlyListenerTest.php b/tests/Eccube/Tests/EventListener/ForwardOnlyListenerTest.php deleted file mode 100644 index 41c98217f6f..00000000000 --- a/tests/Eccube/Tests/EventListener/ForwardOnlyListenerTest.php +++ /dev/null @@ -1,31 +0,0 @@ -markTestIncomplete('function shopping is not implement'); - try { - $this->client->request('GET', $this->generateUrl('shopping_check_to_cart')); - self::fail(); - } catch (AccessDeniedHttpException$e) { - self::assertEquals('Eccube\Controller\ShoppingController:checkToCart is Forward Only', $e->getMessage()); - } - } -} diff --git a/tests/Eccube/Tests/Form/Type/Admin/LogTypeTest.php b/tests/Eccube/Tests/Form/Type/Admin/LogTypeTest.php index 9122df64005..9df68d81aab 100644 --- a/tests/Eccube/Tests/Form/Type/Admin/LogTypeTest.php +++ b/tests/Eccube/Tests/Form/Type/Admin/LogTypeTest.php @@ -63,9 +63,6 @@ public function tearDown() public function testValidData() { - if (!file_exists($this->logTest)) { - $this->markTestSkipped('テスト時には'.$this->fileName.'は存在しないのでテストできない'); - } $this->form->submit($this->formData); $this->assertTrue($this->form->isValid()); } diff --git a/tests/Eccube/Tests/Form/Type/Install/Step4TypeTest.php b/tests/Eccube/Tests/Form/Type/Install/Step4TypeTest.php index 040f8c9af53..e3e790c72e2 100644 --- a/tests/Eccube/Tests/Form/Type/Install/Step4TypeTest.php +++ b/tests/Eccube/Tests/Form/Type/Install/Step4TypeTest.php @@ -48,7 +48,7 @@ public function setUp() public function testInvalidData() { // Request に依存しているため WebTest で代替する - $this->markTestSkipped('Can not support of FormInterface::submit()'); + $this->markTestIncomplete('Can not support of FormInterface::submit()'); $this->form->submit($this->formData); $this->assertFalse($this->form->isValid()); diff --git a/tests/Eccube/Tests/Repository/AbstractProductRepositoryTestCase.php b/tests/Eccube/Tests/Repository/AbstractProductRepositoryTestCase.php index da88d067532..74db312be47 100644 --- a/tests/Eccube/Tests/Repository/AbstractProductRepositoryTestCase.php +++ b/tests/Eccube/Tests/Repository/AbstractProductRepositoryTestCase.php @@ -79,6 +79,7 @@ protected function createFavorites($Customer) /** * 商品にタグをつける + * * @param Product $Product * @param array $tagIds */ diff --git a/tests/Eccube/Tests/Repository/AbstractRepositoryTestCase.php b/tests/Eccube/Tests/Repository/AbstractRepositoryTestCase.php deleted file mode 100644 index 5d953b636d2..00000000000 --- a/tests/Eccube/Tests/Repository/AbstractRepositoryTestCase.php +++ /dev/null @@ -1,43 +0,0 @@ -markTestIncomplete(get_class($this).' は未実装です'); - parent::setUp(); - } - - /** - * {@inheritdoc} - */ - public function createApplication() - { - $app = new Application(); - $app->initialize(); - $app['session.test'] = true; - $app['exception_handler']->disable(); - - $app->boot(); - - return $app; - } -} diff --git a/tests/Eccube/Tests/Service/EntityProxyServiceTest.php b/tests/Eccube/Tests/Service/EntityProxyServiceTest.php index 944977a7d8e..ffed2217416 100644 --- a/tests/Eccube/Tests/Service/EntityProxyServiceTest.php +++ b/tests/Eccube/Tests/Service/EntityProxyServiceTest.php @@ -87,7 +87,7 @@ public function testGenerate() public function testGenerateFromOriginalFile() { - $this->markTestSkipped(); + $this->markTestIncomplete(); $findSequence = static function (Tokens $tokens) { return $tokens->findSequence([ diff --git a/tests/Eccube/Tests/Service/MailServiceTest.php b/tests/Eccube/Tests/Service/MailServiceTest.php index e8131eae841..e2a99b47804 100644 --- a/tests/Eccube/Tests/Service/MailServiceTest.php +++ b/tests/Eccube/Tests/Service/MailServiceTest.php @@ -391,7 +391,7 @@ public function testSendPasswordResetCompleteMail() public function testConvertMessageISO() { // TODO https://github.com/EC-CUBE/ec-cube/issues/2402#issuecomment-362487022 - $this->markTestSkipped('実装確認中のためスキップ'); + $this->markTestIncomplete('実装確認中のためスキップ'); $config = $this->app['config']; $config['mail']['charset_iso_2022_jp'] = true; $this->app['config'] = $config; @@ -426,7 +426,7 @@ public function testConvertMessageISO() public function testConvertMessageUTF() { // TODO https://github.com/EC-CUBE/ec-cube/issues/2402#issuecomment-362487022 - $this->markTestSkipped('実装確認中のためスキップ'); + $this->markTestIncomplete('実装確認中のためスキップ'); $config = $this->app['config']; $config['mail']['charset_iso_2022_jp'] = false; @@ -460,7 +460,7 @@ public function testConvertMessageUTF() */ public function testSendShippingNotifyMail() { - $this->markTestSkipped('実装確認中のためスキップ'); + $this->markTestIncomplete('実装確認中のためスキップ'); $Order = $this->Order; /** @var Shipping $Shipping */ $Shipping = $Order->getShippings()->first(); diff --git a/tests/Eccube/Tests/Service/Payment/PaymentMethodTest.php b/tests/Eccube/Tests/Service/Payment/PaymentMethodTest.php index 7b4270d94d4..ff4b371c54e 100644 --- a/tests/Eccube/Tests/Service/Payment/PaymentMethodTest.php +++ b/tests/Eccube/Tests/Service/Payment/PaymentMethodTest.php @@ -19,7 +19,7 @@ class PaymentMethodTest extends EccubeTestCase { public function testConstructorInjection() { - $this->markTestSkipped(); + $this->markTestIncomplete(); $Customer = $this->createCustomer(); $Order = $this->createOrder($Customer); diff --git a/tests/Eccube/Tests/Web/Admin/Content/MaintenanceControllerTest.php b/tests/Eccube/Tests/Web/Admin/Content/MaintenanceControllerTest.php new file mode 100644 index 00000000000..5e29f4ee423 --- /dev/null +++ b/tests/Eccube/Tests/Web/Admin/Content/MaintenanceControllerTest.php @@ -0,0 +1,91 @@ +maintenance_file_path + = self::$container->getParameter('eccube_content_maintenance_file_path'); + + if (file_exists($this->maintenance_file_path)) { + unlink($this->maintenance_file_path); + } + } + + public function tearDown() + { + parent::tearDown(); + + if (file_exists($this->maintenance_file_path)) { + unlink($this->maintenance_file_path); + } + } + + public function testIndex() + { + $crawler = $this->client->request('GET', + $this->generateUrl('admin_content_maintenance') + ); + $this->assertTrue($this->client->getResponse()->isSuccessful()); + $this->assertFalse(file_exists($this->maintenance_file_path)); + $this->assertSame('有効にする', $crawler->filter('button.btn-ec-conversion')->text()); + + touch($this->maintenance_file_path); + + $crawler = $this->client->request('GET', + $this->generateUrl('admin_content_maintenance') + ); + $this->assertTrue($this->client->getResponse()->isSuccessful()); + $this->assertTrue(file_exists($this->maintenance_file_path)); + $this->assertSame('無効にする', $crawler->filter('button.btn-ec-conversion')->text()); + } + + public function testDisableMaintenance() + { + touch($this->maintenance_file_path); + + $crawler = $this->client->request('GET', + $this->generateUrl('admin_content_maintenance') + ); + $this->assertTrue($this->client->getResponse()->isSuccessful()); + $this->assertTrue(file_exists($this->maintenance_file_path)); + $this->assertSame('無効にする', $crawler->filter('button.btn-ec-conversion')->text()); + + $crawler = $this->client->request('POST', + $this->generateUrl('admin_disable_maintenance', ['mode' => 'manual']), + [], + [], + [ + 'HTTP_X-Requested-With' => 'XMLHttpRequest', + 'CONTENT_TYPE' => 'application/json', + ] + ); + $this->assertTrue($this->client->getResponse()->isSuccessful()); + + $crawler = $this->client->request('GET', + $this->generateUrl('admin_content_maintenance') + ); + $this->assertTrue($this->client->getResponse()->isSuccessful()); + $this->assertFalse(file_exists($this->maintenance_file_path)); + $this->assertSame('有効にする', $crawler->filter('button.btn-ec-conversion')->text()); + } +} diff --git a/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php b/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php index 0ca7ab42a4c..a65cbfd48ae 100644 --- a/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php +++ b/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php @@ -165,8 +165,6 @@ public function testNotUpdateLastBuyDate() public function testOrderCustomerInfo() { - $this->markTestSkipped('顧客の購入回数と購入金額の実装が完了するまでスキップ'); - $this->markTestIncomplete('EditController is not implemented.'); $Customer = $this->createCustomer(); $Order = $this->createOrder($Customer); $Order->setOrderStatus($this->entityManager->find(OrderStatus::class, OrderStatus::NEW)); @@ -304,7 +302,7 @@ public function testOrderProcessingToFrontConfirm() $this->actual = $EditedOrder->getOrderStatus()->getId(); $this->verify(); - $this->markTestSkipped('フロントとのセッション管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('フロントとのセッション管理の実装が完了するまでスキップ'); // フロント側から, product_class_id = 1 をカート投入 $client = $this->createClient(); $client->request( diff --git a/tests/Eccube/Tests/Web/Admin/Order/EditControllerWithMultipleTest.php b/tests/Eccube/Tests/Web/Admin/Order/EditControllerWithMultipleTest.php index 4b7c5607414..3476833e021 100644 --- a/tests/Eccube/Tests/Web/Admin/Order/EditControllerWithMultipleTest.php +++ b/tests/Eccube/Tests/Web/Admin/Order/EditControllerWithMultipleTest.php @@ -40,7 +40,7 @@ public function setUp() public function testRoutingAdminOrderNew() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $this->client->request('GET', $this->app->url('admin_order_new')); $this->assertTrue($this->client->getResponse()->isSuccessful()); @@ -48,7 +48,7 @@ public function testRoutingAdminOrderNew() public function testRoutingAdminOrderNewPost() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Shippings = []; $Shippings[] = $this->createShipping($this->Product->getProductClasses()->toArray()); @@ -68,7 +68,7 @@ public function testRoutingAdminOrderNewPost() public function testRoutingAdminOrderEdit() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Customer = $this->createCustomer(); $Order = $this->createOrder($Customer); @@ -79,7 +79,7 @@ public function testRoutingAdminOrderEdit() public function testRoutingAdminOrderEditPost() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Shippings = []; $Shippings[] = $this->createShipping($this->Product->getProductClasses()->toArray()); @@ -189,7 +189,7 @@ public function testSearchProduct() */ public function testOrderProcessingToFrontConfirm() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Customer = $this->createCustomer(); $Order = $this->createOrder($Customer); @@ -283,7 +283,7 @@ public function testOrderProcessingToFrontConfirm() */ public function testOrderProcessingWithTax() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Shippings = []; $Shippings[] = $this->createShipping($this->Product->getProductClasses()->toArray()); @@ -338,7 +338,7 @@ public function testOrderProcessingWithTax() public function testOrderEditWithShippingItemDelete() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Shippings = []; $Shippings[] = $this->createShipping($this->Product->getProductClasses()->toArray()); @@ -398,7 +398,7 @@ public function testOrderEditWithShippingItemDelete() public function testOrderEditWithShippingDelete() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $Shippings = []; $Shippings[] = $this->createShipping($this->Product->getProductClasses()->toArray()); diff --git a/tests/Eccube/Tests/Web/Admin/Order/OrderControllerTest.php b/tests/Eccube/Tests/Web/Admin/Order/OrderControllerTest.php index 85eb2c0b2c4..63fd86a8ed8 100644 --- a/tests/Eccube/Tests/Web/Admin/Order/OrderControllerTest.php +++ b/tests/Eccube/Tests/Web/Admin/Order/OrderControllerTest.php @@ -336,7 +336,7 @@ public function testSearchWithEmail() */ public function testBulkOrderStatus($orderStatusId) { - $this->markTestSkipped('使用していないルーティングのためスキップ.'); + $this->markTestIncomplete('使用していないルーティングのためスキップ.'); // case true $orderIds = []; /** @var Order[] $Orders */ diff --git a/tests/Eccube/Tests/Web/Mypage/MypageControllerTest.php b/tests/Eccube/Tests/Web/Mypage/MypageControllerTest.php index ee289b6dd50..0be64dcad13 100644 --- a/tests/Eccube/Tests/Web/Mypage/MypageControllerTest.php +++ b/tests/Eccube/Tests/Web/Mypage/MypageControllerTest.php @@ -108,8 +108,6 @@ public function testIndex() public function testHistory() { - $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); - $Product = $this->createProduct(); $ProductClasses = $Product->getProductClasses(); // 後方互換のため最初の1つのみ渡す diff --git a/tests/Eccube/Tests/Web/ProductControllerTest.php b/tests/Eccube/Tests/Web/ProductControllerTest.php index 606593a8521..5ac9b4fd778 100644 --- a/tests/Eccube/Tests/Web/ProductControllerTest.php +++ b/tests/Eccube/Tests/Web/ProductControllerTest.php @@ -326,7 +326,7 @@ public function testMetaTagsInDetailPage() $expected_desc = mb_substr($description_list, 0, 120, 'utf-8'); $url = $this->generateUrl('product_detail', ['id' => 2], UrlGeneratorInterface::ABSOLUTE_URL); - $imgPath = $this->generateUrl('homepage', [], UrlGeneratorInterface::ABSOLUTE_URL) . 'html/upload/save_image/' . $product->getMainListImage()->getFileName(); + $imgPath = $this->generateUrl('homepage', [], UrlGeneratorInterface::ABSOLUTE_URL).'html/upload/save_image/'.$product->getMainListImage()->getFileName(); $crawler = $this->client->request('GET', $url); diff --git a/tests/Eccube/Tests/Web/ShoppingControllerTest.php b/tests/Eccube/Tests/Web/ShoppingControllerTest.php index 3f4f819915f..dc2d4877374 100644 --- a/tests/Eccube/Tests/Web/ShoppingControllerTest.php +++ b/tests/Eccube/Tests/Web/ShoppingControllerTest.php @@ -402,7 +402,7 @@ public function testShippingChangeWithPost() */ public function testShippingShippingPost() { - $this->markTestSkipped('新しい配送管理の実装が完了するまでスキップ'); + $this->markTestIncomplete('新しい配送管理の実装が完了するまでスキップ'); $faker = $this->getFaker(); $Customer = $this->logIn();