From 35ea2bfbdf79581676309deea4044c38e4774769 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Sat, 7 May 2022 01:37:45 +0900 Subject: [PATCH 01/16] =?UTF-8?q?LC=5FPage=5FAdmin=5F*=5FEx=20=E3=81=AE?= =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=83=91=E3=82=B9=E3=81=8C=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E3=81=AB=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_ClassAutoloader.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/class/SC_ClassAutoloader.php b/data/class/SC_ClassAutoloader.php index 9ed4dd2c63..12cc175ea2 100644 --- a/data/class/SC_ClassAutoloader.php +++ b/data/class/SC_ClassAutoloader.php @@ -48,7 +48,11 @@ public static function autoload($class, $plugin_upload_realdir = PLUGIN_UPLOAD_R $arrClassNamePartTemp = $arrClassNamePart; // FIXME クラスファイルのディレクトリ命名が変。変な現状に合わせて強引な処理をしてる。 $arrClassNamePartTemp[1] = $arrClassNamePartTemp[1] . '_extends'; - $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -2))) . '/'; + if ($count <= 5 && $arrClassNamePart[2] === 'Admin') { + $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -1))) . '/'; + } else { + $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -2))) . '/'; + } } elseif ($arrClassNamePart[0] === 'SC' && $is_ex === false && $count >= 3) { $classpath .= strtolower(implode('/', array_slice($arrClassNamePart, 1, -1))) . '/'; } elseif ($arrClassNamePart[0] === 'SC') { From 884bab71223465475845bc8664f8cb288ecec877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Mon, 13 Jun 2022 16:06:45 +0900 Subject: [PATCH 02/16] =?UTF-8?q?=E8=AA=8D=E8=A8=BCsmtp=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=8C=E9=80=81=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_SendMail.php | 3 ++- data/module/Net/Socket.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/class/SC_SendMail.php b/data/class/SC_SendMail.php index d7e8b6a145..aeb6236311 100644 --- a/data/class/SC_SendMail.php +++ b/data/class/SC_SendMail.php @@ -340,6 +340,7 @@ public function sendMail($isHtml = false) $msg = mb_convert_encoding($result->getMessage(), CHAR_CODE, 'auto'); $msg = 'メール送信に失敗しました。[' . $msg . ']'; trigger_error($msg, E_USER_WARNING); + GC_Utils_Ex::gfPrintLog($result->getMessage()); GC_Utils_Ex::gfDebugLog($header); return false; @@ -392,7 +393,7 @@ public function getBackendParams($backend) && defined('SMTP_PASSWORD') && !SC_Utils_Ex::isBlank(SMTP_USER) && !SC_Utils_Ex::isBlank(SMTP_PASSWORD)) { - $arrParams['auth'] = true; + $arrParams['auth'] = "PLAIN"; $arrParams['username'] = SMTP_USER; $arrParams['password'] = SMTP_PASSWORD; } diff --git a/data/module/Net/Socket.php b/data/module/Net/Socket.php index 2fee65cd2c..d9edceef27 100644 --- a/data/module/Net/Socket.php +++ b/data/module/Net/Socket.php @@ -644,6 +644,7 @@ function enableCrypto($enabled, $type) if (!is_resource($this->fp)) { return $this->raiseError('not connected'); } + stream_context_set_option($this->fp, 'ssl', 'verify_peer_name', false); return @stream_socket_enable_crypto($this->fp, $enabled, $type); } else { $msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0'; From 1086200c75d04abba0b4abab3e9538b91396beef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Mon, 13 Jun 2022 18:12:44 +0900 Subject: [PATCH 03/16] =?UTF-8?q?test=E3=81=8C=E8=90=BD=E3=81=A1=E3=82=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_SendMail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/class/SC_SendMail.php b/data/class/SC_SendMail.php index aeb6236311..70c9228820 100644 --- a/data/class/SC_SendMail.php +++ b/data/class/SC_SendMail.php @@ -393,7 +393,7 @@ public function getBackendParams($backend) && defined('SMTP_PASSWORD') && !SC_Utils_Ex::isBlank(SMTP_USER) && !SC_Utils_Ex::isBlank(SMTP_PASSWORD)) { - $arrParams['auth'] = "PLAIN"; + $arrParams['auth'] = true; $arrParams['username'] = SMTP_USER; $arrParams['password'] = SMTP_PASSWORD; } From 1705f85379b0962ad75493c4c639d762ae242a72 Mon Sep 17 00:00:00 2001 From: KIMOTO Nobuhiko Date: Wed, 27 Jul 2022 15:36:27 +0900 Subject: [PATCH 04/16] Update dependabot.yml --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 46783880e4..a939885b70 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,15 @@ updates: interval: "weekly" allow: - dependency-type: "all" + + # GitHub アクションの依存関係を維持する + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + # npm の依存関係を維持する + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" From 10f38a5fea43b4fa331523ba7c207395867c4b5d Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 27 Jul 2022 20:17:11 +0000 Subject: [PATCH 05/16] fix: upgrade webpack from 5.69.1 to 5.73.0 Snyk has created this PR to upgrade webpack from 5.69.1 to 5.73.0. See this package in npm: See this project in Snyk: https://app.snyk.io/org/nobuhiko/project/f6260ae3-109d-4dfe-aaaa-873ab966ddfb?utm_source=github&utm_medium=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 47 ++++++++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index c9c54add69..2583a9d540 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "slick-carousel": "^1.8.1", "style-loader": "^3.3.0", "url-loader": "^4.1.1", - "webpack": "^5.69.1" + "webpack": "^5.73.0" }, "devDependencies": { "@babel/core": "^7.17.5", diff --git a/yarn.lock b/yarn.lock index 9e5318ee31..027da5a5de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1446,11 +1446,16 @@ acorn-jsx@^5.3.1: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.0: +acorn@^8.5.0, acorn@^8.7.0: version "8.7.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== +acorn@^8.7.1: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -1962,10 +1967,10 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.8.3: - version "5.9.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.1.tgz#e898cea44d9199fd92137496cff5691b910fb43e" - integrity sha512-jdyZMwCQ5Oj4c5+BTnkxPgDZO/BJzh/ADDmKebayyzNwjVX1AFCeGkOfxNx0mHi2+8BKC5VxUYiw3TIvoT7vhw== +enhanced-resolve@^5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" + integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -2901,10 +2906,10 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= -json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== +json-parse-even-better-errors@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-schema-traverse@^0.4.1: version "0.4.1" @@ -4113,10 +4118,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -watchpack@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25" - integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA== +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -4152,34 +4157,34 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.69.1: - version "5.69.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.69.1.tgz#8cfd92c192c6a52c99ab00529b5a0d33aa848dc5" - integrity sha512-+VyvOSJXZMT2V5vLzOnDuMz5GxEqLk7hKWQ56YxPW/PQRUuKimPqmEIJOx8jHYeyo65pKbapbW464mvsKbaj4A== +webpack@^5.73.0: + version "5.74.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" + integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" "@webassemblyjs/ast" "1.11.1" "@webassemblyjs/wasm-edit" "1.11.1" "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" + acorn "^8.7.1" acorn-import-assertions "^1.7.6" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.8.3" + enhanced-resolve "^5.10.0" es-module-lexer "^0.9.0" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" graceful-fs "^4.2.9" - json-parse-better-errors "^1.0.2" + json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" schema-utils "^3.1.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.3" - watchpack "^2.3.1" + watchpack "^2.4.0" webpack-sources "^3.2.3" which-boxed-primitive@^1.0.2: From c7cd2ecaf92622cc1921ec3bb039a252e53998d8 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 27 Jul 2022 20:17:14 +0000 Subject: [PATCH 06/16] fix: upgrade css-loader from 6.6.0 to 6.7.1 Snyk has created this PR to upgrade css-loader from 6.6.0 to 6.7.1. See this package in npm: See this project in Snyk: https://app.snyk.io/org/nobuhiko/project/f6260ae3-109d-4dfe-aaaa-873ab966ddfb?utm_source=github&utm_medium=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index c9c54add69..c4019b6dd8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "GPL", "dependencies": { "@babel/polyfill": "^7.12.1", - "css-loader": "^6.6.0", + "css-loader": "^6.7.1", "date-fns": "^2.28.0", "jquery": "3", "jquery-colorbox": "^1.6.4", diff --git a/yarn.lock b/yarn.lock index 9e5318ee31..b82ebeb84b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1837,13 +1837,13 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -css-loader@^6.6.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.6.0.tgz#c792ad5510bd1712618b49381bd0310574fafbd3" - integrity sha512-FK7H2lisOixPT406s5gZM1S3l8GrfhEBT3ZiL2UX1Ng1XWs0y2GPllz/OTyvbaHe12VgQrIXIzuEGVlbUhodqg== +css-loader@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.7.1.tgz#e98106f154f6e1baf3fc3bc455cb9981c1d5fd2e" + integrity sha512-yB5CNFa14MbPJcomwNh3wLThtkZgcNyI2bNMRt8iE5Z8Vwl7f8vQXFAzn2HDOJvtDq2NTZBUGMSUNNyrv3/+cw== dependencies: icss-utils "^5.1.0" - postcss "^8.4.5" + postcss "^8.4.7" postcss-modules-extract-imports "^3.0.0" postcss-modules-local-by-default "^4.0.0" postcss-modules-scope "^3.0.0" @@ -3137,10 +3137,10 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" - integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== natural-compare@^1.4.0: version "1.4.0" @@ -3434,12 +3434,12 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@^8.4.5: - version "8.4.7" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.7.tgz#f99862069ec4541de386bf57f5660a6c7a0875a8" - integrity sha512-L9Ye3r6hkkCeOETQX6iOaWZgjp3LL6Lpqm6EtgbKrgqGGteRMNb9vzBfRL96YOSu8o7x3MfIH9Mo5cPJFGrW6A== +postcss@^8.4.7: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== dependencies: - nanoid "^3.3.1" + nanoid "^3.3.4" picocolors "^1.0.0" source-map-js "^1.0.2" From fbcd9a1b1aae40878cb4433dd80180434605cf05 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 27 Jul 2022 20:17:17 +0000 Subject: [PATCH 07/16] fix: upgrade jquery-migrate from 3.3.2 to 3.4.0 Snyk has created this PR to upgrade jquery-migrate from 3.3.2 to 3.4.0. See this package in npm: See this project in Snyk: https://app.snyk.io/org/nobuhiko/project/f6260ae3-109d-4dfe-aaaa-873ab966ddfb?utm_source=github&utm_medium=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c9c54add69..f16a336312 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "jquery": "3", "jquery-colorbox": "^1.6.4", "jquery-easing": "^0.0.1", - "jquery-migrate": "^3.1.0", + "jquery-migrate": "^3.4.0", "slick-carousel": "^1.8.1", "style-loader": "^3.3.0", "url-loader": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 9e5318ee31..3241066b45 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2864,10 +2864,10 @@ jquery-easing@^0.0.1: dependencies: jquery "*" -jquery-migrate@^3.1.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/jquery-migrate/-/jquery-migrate-3.3.2.tgz#7829ee24de3054d0d2f42dd093390d8a7b7af01a" - integrity sha512-L3gYhr7yEtLUSAeqXSicVa0vRD4aGwjw/bWY8YzrO2o/qDY1BaMyP3oB3bZf5Auy3Hu9ynliio0CTyDWCBPVDw== +jquery-migrate@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/jquery-migrate/-/jquery-migrate-3.4.0.tgz#915d6e914c76bd7410a58c86d20fec0052784af9" + integrity sha512-K0W02EhZyqjVpyF5pdi+t238cIfQACzMsXiX4AEfEOxPPfiZZFzf3brtFY21FOOEPiWZF4mH04TXHDE6e2YDyg== jquery@*, jquery@3, jquery@>=1.3.2: version "3.6.0" From c494b296867581d2a1dd49f83d6f8f55f7713039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Thu, 28 Jul 2022 22:47:33 +0900 Subject: [PATCH 08/16] =?UTF-8?q?guzzle=E3=81=8Bmailcatcher=E3=81=AE?= =?UTF-8?q?=E8=BF=94=E3=82=8A=E5=80=A4=E3=81=8C=E5=A4=89=E3=82=8F=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=BD=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/class/Common_TestCase.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/class/Common_TestCase.php b/tests/class/Common_TestCase.php index 01c5b2dcf1..126cb4efe3 100644 --- a/tests/class/Common_TestCase.php +++ b/tests/class/Common_TestCase.php @@ -116,14 +116,12 @@ protected function getMailCatcherMessages() * @param int $id メッセージの ID * @return array MailCatcher のメッセージ */ - protected function getMailCatcherMessage($id) + protected function getMailCatcherMessage($message) { $client = new \GuzzleHttp\Client(['base_url' => self::MAILCATCHER_URL]); - $response = $client->get('/messages/'.$id.'.json'); + $source = (string) $client->get('/messages/'.$message['id'].'.source')->getBody(); - $message = json_decode($response->getBody(true), true); - - $message['source'] = quoted_printable_decode($message['source']); + $message['source'] = quoted_printable_decode($source); $message['source'] = mb_convert_encoding($message['source'], 'UTF-8', 'JIS'); return $message; } @@ -141,7 +139,7 @@ protected function getLastMailCatcherMessage() } $last = array_shift($messages); - return $this->getMailCatcherMessage($last['id']); + return $this->getMailCatcherMessage($last); } From d64ecc6111d4c08ef0c601871343fc3797c10a83 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 29 Jul 2022 16:20:52 +0900 Subject: [PATCH 09/16] Fix phpstan > Class Net_URL does not have a constructor and must be instantiated without any parameters. --- data/module/Net/URL.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/data/module/Net/URL.php b/data/module/Net/URL.php index dc03705189..005890b462 100644 --- a/data/module/Net/URL.php +++ b/data/module/Net/URL.php @@ -106,16 +106,6 @@ class Net_URL */ var $useBrackets; - /** - * PHP4 Constructor - * - * @see __construct() - */ - function Net_URL($url = null, $useBrackets = true) - { - $this->__construct($url, $useBrackets); - } - /** * PHP5 Constructor * @@ -127,7 +117,7 @@ function Net_URL($url = null, $useBrackets = true) * multiple querystrings with the same name * exist */ - function __construct($url = null, $useBrackets = true) + public function __construct($url = null, $useBrackets = true) { $this->url = $url; $this->useBrackets = $useBrackets; From 70fc75037fbcb4a2293b933d07bc20e5eef3a190 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 29 Jul 2022 16:23:06 +0900 Subject: [PATCH 10/16] =?UTF-8?q?PHPStan=20=E3=81=8C=20MDB2=20=E3=82=92?= =?UTF-8?q?=E8=A6=8B=E3=81=A4=E3=81=91=E3=81=A6=E3=81=8F=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/require.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/require.php b/tests/require.php index aa427b1e4a..73154f19eb 100644 --- a/tests/require.php +++ b/tests/require.php @@ -7,8 +7,10 @@ exit(1); } -class_exists('FPDI'); // XXX PHPStan が FPDI を見つけてくれないのでロードしておく -class_exists('Smarty'); // XXX PHPStan が Smarty を見つけてくれないのでロードしておく +// XXX PHPStan が見つけてくれないライブラリをロードしておく +class_exists('FPDI'); +class_exists('Smarty'); +class_exists('MDB2'); if (!class_exists('PHPUnit_Framework_TestCase')) { class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase'); From 5969d754868b436f8c1cff3d7abd687269148cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Fri, 29 Jul 2022 18:19:13 +0900 Subject: [PATCH 11/16] =?UTF-8?q?guzzlehttp/guzzle=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 1 - composer.lock | 248 +------------------------------- tests/class/Common_TestCase.php | 28 ++-- 3 files changed, 21 insertions(+), 256 deletions(-) diff --git a/composer.json b/composer.json index c0bbac0197..29263b233c 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,6 @@ }, "require-dev": { "fzaninotto/faker": "^1.8", - "guzzlehttp/guzzle": "^5.3", "nanasess/eccube2-fixture-generator": "^1.1", "nanasess/ec-cube2-class-extends-stubs": "^1.0", "php5friends/phpunit48": ">=4.8.41" diff --git a/composer.lock b/composer.lock index 7460eaaf7c..eaf37535eb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "aa69a1cefb969fb840164cf96cb39350", + "content-hash": "af90042f8bc44df63d44bc963ea3f29e", "packages": [ { "name": "mobiledetect/mobiledetectlib", @@ -905,174 +905,6 @@ "abandoned": true, "time": "2020-12-11T09:56:16+00:00" }, - { - "name": "guzzlehttp/guzzle", - "version": "5.3.4", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/5.3" - }, - "time": "2019-10-30T09:32:00+00:00" - }, - { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "support": { - "issues": "https://github.com/guzzle/RingPHP/issues", - "source": "https://github.com/guzzle/RingPHP/tree/1.1.1" - }, - "abandoned": true, - "time": "2018-07-31T13:22:33+00:00" - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "support": { - "issues": "https://github.com/guzzle/streams/issues", - "source": "https://github.com/guzzle/streams/tree/master" - }, - "abandoned": true, - "time": "2014-10-12T19:18:40+00:00" - }, { "name": "nanasess/ec-cube2-class-extends-stubs", "version": "1.0.0", @@ -1743,82 +1575,6 @@ "abandoned": true, "time": "2015-10-02T06:51:40+00:00" }, - { - "name": "react/promise", - "version": "v2.9.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-11T10:27:51+00:00" - }, { "name": "sebastian/comparator", "version": "1.2.4", @@ -2311,5 +2067,5 @@ "platform-overrides": { "php": "5.4.16" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } diff --git a/tests/class/Common_TestCase.php b/tests/class/Common_TestCase.php index 126cb4efe3..86fd3fe122 100644 --- a/tests/class/Common_TestCase.php +++ b/tests/class/Common_TestCase.php @@ -76,7 +76,13 @@ protected function checkMailCatcherStatus() try { $client = new \GuzzleHttp\Client(['base_url' => self::MAILCATCHER_URL]); $response = $client->get('/messages'); - if ($response->getStatusCode() !== 200) { + $context = stream_context_create(array( + 'http' => array('ignore_errors' => true) + )); + $response = file_get_contents(self::MAILCATCHER_URL.'/messages', false, $context); + + $http_status = strpos($http_response_header[0], '200'); + if ($http_status === false) { $this->markTestSkipped('MailCatcher is not available'); } } catch (Exception $e) { @@ -90,8 +96,16 @@ protected function checkMailCatcherStatus() protected function resetEmails() { try { - $client = new \GuzzleHttp\Client(['base_url' => self::MAILCATCHER_URL]); - $client->delete('/messages'); + $context = stream_context_create( + array( + 'http' => array( + 'method'=> 'DELETE' + ) + ) + ); + + file_get_contents(self::MAILCATCHER_URL.'/messages', false, $context); + } catch (\Exception $e) { // quiet } @@ -104,10 +118,7 @@ protected function resetEmails() */ protected function getMailCatcherMessages() { - $client = new \GuzzleHttp\Client(['base_url' => self::MAILCATCHER_URL]); - $response = $client->get('/messages'); - - return json_decode($response->getBody(true), true); + return json_decode(file_get_contents(self::MAILCATCHER_URL. '/messages'), true); } /** @@ -118,8 +129,7 @@ protected function getMailCatcherMessages() */ protected function getMailCatcherMessage($message) { - $client = new \GuzzleHttp\Client(['base_url' => self::MAILCATCHER_URL]); - $source = (string) $client->get('/messages/'.$message['id'].'.source')->getBody(); + $source = file_get_contents(self::MAILCATCHER_URL. '/messages/'.$message['id'].'.source'); $message['source'] = quoted_printable_decode($source); $message['source'] = mb_convert_encoding($message['source'], 'UTF-8', 'JIS'); From 30bb157eb34f5d0486bcc478125befa61637f562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Fri, 29 Jul 2022 19:13:19 +0900 Subject: [PATCH 12/16] =?UTF-8?q?=E5=89=8A=E9=99=A4=E6=BC=8F=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/class/Common_TestCase.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/class/Common_TestCase.php b/tests/class/Common_TestCase.php index 86fd3fe122..f3e006a132 100644 --- a/tests/class/Common_TestCase.php +++ b/tests/class/Common_TestCase.php @@ -74,8 +74,6 @@ protected function verify($message = null) protected function checkMailCatcherStatus() { try { - $client = new \GuzzleHttp\Client(['base_url' => self::MAILCATCHER_URL]); - $response = $client->get('/messages'); $context = stream_context_create(array( 'http' => array('ignore_errors' => true) )); From 45923efec732cad8b18ccbae46ac184312200f9a Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Mon, 1 Aug 2022 15:30:46 +0900 Subject: [PATCH 13/16] =?UTF-8?q?LC=5FPage=5FAdmin=5F(Home|Index|Logout)?= =?UTF-8?q?=5FEx=20=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_ClassAutoloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/class/SC_ClassAutoloader.php b/data/class/SC_ClassAutoloader.php index 12cc175ea2..323cfd672a 100644 --- a/data/class/SC_ClassAutoloader.php +++ b/data/class/SC_ClassAutoloader.php @@ -48,7 +48,7 @@ public static function autoload($class, $plugin_upload_realdir = PLUGIN_UPLOAD_R $arrClassNamePartTemp = $arrClassNamePart; // FIXME クラスファイルのディレクトリ命名が変。変な現状に合わせて強引な処理をしてる。 $arrClassNamePartTemp[1] = $arrClassNamePartTemp[1] . '_extends'; - if ($count <= 5 && $arrClassNamePart[2] === 'Admin') { + if ($count <= 5 && $arrClassNamePart[2] === 'Admin' && !in_array($arrClassNamePart[3], ['Home', 'Index', 'Logout'])) { $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -1))) . '/'; } else { $classpath .= strtolower(implode('/', array_slice($arrClassNamePartTemp, 1, -2))) . '/'; From 03664ad81e96df1209a8099f5e60d9985e8e7821 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Mon, 1 Aug 2022 17:45:41 +0900 Subject: [PATCH 14/16] =?UTF-8?q?*=5FEx=20=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9F=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AE=20E2E=20=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 9 +++++- e2e-tests/test/admin/customer/edit.test.ts | 22 ++++++++++++++ e2e-tests/test/admin/home.test.ts | 24 +++++++-------- e2e-tests/test/admin/index.test.ts | 28 +++++++++++++++++ e2e-tests/test/admin/total/total.test.ts | 5 ++++ e2e-tests/test/front_guest/welcome.test.ts | 30 +++++++++++++++++++ .../test/front_login/mypage/change.test.ts | 22 ++++++++++++++ e2e-tests/test/front_login/welcome.test.ts | 5 ++++ package.json | 5 ++-- .../page_extends/LC_Page_Index_Ex.php | 14 +++++++++ .../admin/LC_Page_Admin_Home_Ex.php | 21 +++++++++++++ .../LC_Page_Admin_Customer_Edit_Ex.php | 14 +++++++++ .../admin/total/LC_Page_Admin_Total_Ex.php | 14 +++++++++ .../mypage/LC_Page_Mypage_Change_Ex.php | 14 +++++++++ 14 files changed, 212 insertions(+), 15 deletions(-) create mode 100644 e2e-tests/test/admin/customer/edit.test.ts create mode 100644 e2e-tests/test/admin/index.test.ts create mode 100644 e2e-tests/test/front_guest/welcome.test.ts create mode 100644 e2e-tests/test/front_login/mypage/change.test.ts create mode 100644 tests/class/fixtures/page_extends/LC_Page_Index_Ex.php create mode 100644 tests/class/fixtures/page_extends/admin/LC_Page_Admin_Home_Ex.php create mode 100644 tests/class/fixtures/page_extends/admin/customer/LC_Page_Admin_Customer_Edit_Ex.php create mode 100644 tests/class/fixtures/page_extends/admin/total/LC_Page_Admin_Total_Ex.php create mode 100644 tests/class/fixtures/page_extends/mypage/LC_Page_Mypage_Change_Ex.php diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 0efbb29d95..8bf9a4008e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -19,6 +19,9 @@ jobs: strategy: fail-fast: false matrix: + pattern: + - 'test:e2e' + - 'test:e2e-extends' group: - 'test/front_login' - 'test/front_guest' @@ -35,6 +38,9 @@ jobs: - name: Setup environment run: echo "COMPOSE_FILE=docker-compose.yml:docker-compose.pgsql.yml:docker-compose.dev.yml:docker-compose.owaspzap.yml:docker-compose.owaspzap.daemon.yml" >> $GITHUB_ENV + - if: matrix.pattern == 'test:e2e-extends' + run: cp -rp tests/class/fixtures/page_extends/* data/class_extends/page_extends + - name: Setup to EC-CUBE env: HTTP_URL: https://127.0.0.1:8085/ @@ -57,11 +63,12 @@ jobs: - name: Run to E2E testing env: GROUP: ${{ matrix.group }} + PATTERN: ${{ matrix.pattern }} HTTPS_PROXY: 'localhost:8090' HTTP_PROXY: 'localhost:8090' CI: 1 FORCE_COLOR: 1 - run: yarn test:e2e e2e-tests/${GROUP} + run: yarn ${PATTERN} e2e-tests/${GROUP} - name: Upload evidence if: failure() diff --git a/e2e-tests/test/admin/customer/edit.test.ts b/e2e-tests/test/admin/customer/edit.test.ts new file mode 100644 index 0000000000..6629dae6f0 --- /dev/null +++ b/e2e-tests/test/admin/customer/edit.test.ts @@ -0,0 +1,22 @@ +import { test, expect } from '@playwright/test'; +import PlaywrightConfig from '../../../../playwright.config'; +import { ZapClient, ContextType } from '../../../utils/ZapClient'; +const zapClient = new ZapClient(); + +const url = `${PlaywrightConfig.use.baseURL}/admin/customer/edit.php`; +test.describe.serial('会員登録画面のテストをします', () => { + test.beforeAll(async () => { + await zapClient.startSession(ContextType.Admin, 'admin_customer_edit') + .then(async () => expect(await zapClient.isForcedUserModeEnabled()).toBeTruthy()); + }); + + test('会員登録画面のテストをします', async ( { page }) => { + await page.goto(url); + await expect(page.locator('h1')).toContainText(/会員登録/); + }); + + test('LC_Page_Admin_Customer_Edit_Ex クラスのテストをします @extends', async ( { page }) => { + await page.goto(url); + await expect(page.locator('h1')).toContainText(/カスタマイズ/); + }); +}); diff --git a/e2e-tests/test/admin/home.test.ts b/e2e-tests/test/admin/home.test.ts index 4e6bde2349..24efb02199 100644 --- a/e2e-tests/test/admin/home.test.ts +++ b/e2e-tests/test/admin/home.test.ts @@ -1,28 +1,28 @@ import { test, expect, chromium, Page } from '@playwright/test'; import { ADMIN_DIR } from '../../config/default.config'; +import { ZapClient, ContextType } from '../../utils/ZapClient'; +const zapClient = new ZapClient(); -const url = `/${ADMIN_DIR}index.php`; +const url = `/${ADMIN_DIR}/home.php`; -test.describe.serial('管理画面に正常にログインできるか確認します', () => { +test.describe.serial('管理画面Homeの確認をします', () => { let page: Page; test.beforeAll(async () => { + await zapClient.startSession(ContextType.Admin, 'admin_home') + .then(async () => expect(await zapClient.isForcedUserModeEnabled()).toBeTruthy()); const browser = await chromium.launch(); page = await browser.newPage(); await page.goto(url); }); - test('ログイン画面を確認します', async () => { - await expect(page.locator('#login-form')).toContainText(/LOGIN/); - }); - - test('ログインします', async () => { - await page.fill('input[name=login_id]', 'admin'); - await page.fill('input[name=password]', 'password'); - await page.click('text=LOGIN'); + test('システム情報を確認します', async ({ page }) => { + await page.goto(url); + await expect(page.locator('.shop-info >> nth=0 >> tr >> nth=0 >> td')).toContainText('2.17'); }); - test('ログインしたのを確認します', async () => { - await expect(page.locator('#site-check')).toContainText('ログイン : 管理者 様'); + test('LC_Page_Admin_Home_Ex クラスのテストをします @extends', async ({ page }) => { + await page.goto(url); + await expect(page.locator('.shop-info >> nth=0 >> tr >> nth=1 >> td')).toContainText('PHP_VERSION_ID'); }); }); diff --git a/e2e-tests/test/admin/index.test.ts b/e2e-tests/test/admin/index.test.ts new file mode 100644 index 0000000000..4e6bde2349 --- /dev/null +++ b/e2e-tests/test/admin/index.test.ts @@ -0,0 +1,28 @@ +import { test, expect, chromium, Page } from '@playwright/test'; +import { ADMIN_DIR } from '../../config/default.config'; + +const url = `/${ADMIN_DIR}index.php`; + +test.describe.serial('管理画面に正常にログインできるか確認します', () => { + let page: Page; + test.beforeAll(async () => { + const browser = await chromium.launch(); + + page = await browser.newPage(); + await page.goto(url); + }); + + test('ログイン画面を確認します', async () => { + await expect(page.locator('#login-form')).toContainText(/LOGIN/); + }); + + test('ログインします', async () => { + await page.fill('input[name=login_id]', 'admin'); + await page.fill('input[name=password]', 'password'); + await page.click('text=LOGIN'); + }); + + test('ログインしたのを確認します', async () => { + await expect(page.locator('#site-check')).toContainText('ログイン : 管理者 様'); + }); +}); diff --git a/e2e-tests/test/admin/total/total.test.ts b/e2e-tests/test/admin/total/total.test.ts index b41b36604e..e0ad3ad824 100644 --- a/e2e-tests/test/admin/total/total.test.ts +++ b/e2e-tests/test/admin/total/total.test.ts @@ -313,4 +313,9 @@ test.describe.serial('売上集計画面を確認をします', () => { .then(file => expect(file.split('\r\n').length).toBeGreaterThanOrEqual(2)); }); }); + + test('LC_Page_Admin_Total_Ex クラスのテストをします @extends', async ( { page }) => { + await page.goto(url); + await expect(page.locator('h1')).toContainText(/カスタマイズ/); + }); }); diff --git a/e2e-tests/test/front_guest/welcome.test.ts b/e2e-tests/test/front_guest/welcome.test.ts new file mode 100644 index 0000000000..94477161ac --- /dev/null +++ b/e2e-tests/test/front_guest/welcome.test.ts @@ -0,0 +1,30 @@ +import { test, expect, chromium, Page } from '@playwright/test'; + +const url = '/index.php'; + +test.describe.serial('トップページのテストをします', () => { + let page: Page; + test.beforeAll(async () => { + const browser = await chromium.launch(); + page = await browser.newPage(); + await page.goto(url); + }); + + test('TOPページが正常に見られているかを確認します', async () => { + await expect(page.locator('#site_description')).toHaveText('EC-CUBE発!世界中を旅して見つけた立方体グルメを立方隊長が直送!'); + await expect(page.locator('#main_image')).toBeVisible(); + }); + + test('body の class 名出力を確認します', async () => { + await expect(page.locator('body')).toHaveAttribute('class', 'LC_Page_Index'); + }); + + test('システムエラーが出ていないのを確認します', async () => { + await expect(page.locator('.error')).not.toBeVisible(); + }); + + test('LC_Page_Index_Ex クラスのテストをします @extends', async ( { page }) => { + await page.goto(url); + await expect(page).toHaveTitle(/カスタマイズ/); + }); +}); diff --git a/e2e-tests/test/front_login/mypage/change.test.ts b/e2e-tests/test/front_login/mypage/change.test.ts new file mode 100644 index 0000000000..d7345787f7 --- /dev/null +++ b/e2e-tests/test/front_login/mypage/change.test.ts @@ -0,0 +1,22 @@ +import { test, expect } from '@playwright/test'; +import PlaywrightConfig from '../../../../playwright.config'; +import { ZapClient, ContextType } from '../../../utils/ZapClient'; +const zapClient = new ZapClient(); + +const url = `${PlaywrightConfig.use.baseURL}/mypage/change.php`; +test.describe.serial('会員登録内容変更画面のテストをします', () => { + test.beforeAll(async () => { + await zapClient.startSession(ContextType.FrontLogin, 'front_login_mypage_change') + .then(async () => expect(await zapClient.isForcedUserModeEnabled()).toBeTruthy()); + }); + + test('会員登録内容変更画面のテストをします', async ( { page }) => { + await page.goto(url); + await expect(page).toHaveTitle(/会員登録内容変更/); + }); + + test('LC_Page_Mypage_Change_Ex クラスのテストをします @extends', async ( { page }) => { + await page.goto(url); + await expect(page).toHaveTitle(/カスタマイズ/); + }); +}); diff --git a/e2e-tests/test/front_login/welcome.test.ts b/e2e-tests/test/front_login/welcome.test.ts index 26aa1b0148..94477161ac 100644 --- a/e2e-tests/test/front_login/welcome.test.ts +++ b/e2e-tests/test/front_login/welcome.test.ts @@ -22,4 +22,9 @@ test.describe.serial('トップページのテストをします', () => { test('システムエラーが出ていないのを確認します', async () => { await expect(page.locator('.error')).not.toBeVisible(); }); + + test('LC_Page_Index_Ex クラスのテストをします @extends', async ( { page }) => { + await page.goto(url); + await expect(page).toHaveTitle(/カスタマイズ/); + }); }); diff --git a/package.json b/package.json index c9c54add69..7370a92a0e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "scripts": { "lint:javascript": "eslint --fix data/*.js", "lint:typescript": "eslint --fix --ext .ts e2e-tests", - "test:e2e": "playwright test --grep-invert @attack", - "test:attack": "playwright test" + "test:e2e": "playwright test --grep-invert '(@attack|@extends)'", + "test:e2e-extends": "playwright test --grep @extends", + "test:attack": "playwright test --grep-invert @extends" } } diff --git a/tests/class/fixtures/page_extends/LC_Page_Index_Ex.php b/tests/class/fixtures/page_extends/LC_Page_Index_Ex.php new file mode 100644 index 0000000000..440737ead7 --- /dev/null +++ b/tests/class/fixtures/page_extends/LC_Page_Index_Ex.php @@ -0,0 +1,14 @@ +tpl_subtitle = '(カスタマイズ)'; + } + + public function process() + { + parent::process(); + } +} diff --git a/tests/class/fixtures/page_extends/admin/LC_Page_Admin_Home_Ex.php b/tests/class/fixtures/page_extends/admin/LC_Page_Admin_Home_Ex.php new file mode 100644 index 0000000000..9a75c4cbaf --- /dev/null +++ b/tests/class/fixtures/page_extends/admin/LC_Page_Admin_Home_Ex.php @@ -0,0 +1,21 @@ +tpl_subtitle = '会員登録(カスタマイズ)'; + } + + public function process() + { + parent::process(); + } +} diff --git a/tests/class/fixtures/page_extends/admin/total/LC_Page_Admin_Total_Ex.php b/tests/class/fixtures/page_extends/admin/total/LC_Page_Admin_Total_Ex.php new file mode 100644 index 0000000000..4c30c5dfa4 --- /dev/null +++ b/tests/class/fixtures/page_extends/admin/total/LC_Page_Admin_Total_Ex.php @@ -0,0 +1,14 @@ +tpl_maintitle = '売上集計(カスタマイズ)'; + } + + public function process() + { + parent::process(); + } +} diff --git a/tests/class/fixtures/page_extends/mypage/LC_Page_Mypage_Change_Ex.php b/tests/class/fixtures/page_extends/mypage/LC_Page_Mypage_Change_Ex.php new file mode 100644 index 0000000000..642499f265 --- /dev/null +++ b/tests/class/fixtures/page_extends/mypage/LC_Page_Mypage_Change_Ex.php @@ -0,0 +1,14 @@ +tpl_subtitle = '会員登録内容変更(カスタマイズ)'; + } + + public function process() + { + parent::process(); + } +} From ff033201b29b9d1e1c26685dea179197e151a891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Mon, 13 Jun 2022 16:06:45 +0900 Subject: [PATCH 15/16] =?UTF-8?q?=E8=AA=8D=E8=A8=BCsmtp=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=8C=E9=80=81=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_SendMail.php | 3 ++- data/module/Net/Socket.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/class/SC_SendMail.php b/data/class/SC_SendMail.php index d7e8b6a145..aeb6236311 100644 --- a/data/class/SC_SendMail.php +++ b/data/class/SC_SendMail.php @@ -340,6 +340,7 @@ public function sendMail($isHtml = false) $msg = mb_convert_encoding($result->getMessage(), CHAR_CODE, 'auto'); $msg = 'メール送信に失敗しました。[' . $msg . ']'; trigger_error($msg, E_USER_WARNING); + GC_Utils_Ex::gfPrintLog($result->getMessage()); GC_Utils_Ex::gfDebugLog($header); return false; @@ -392,7 +393,7 @@ public function getBackendParams($backend) && defined('SMTP_PASSWORD') && !SC_Utils_Ex::isBlank(SMTP_USER) && !SC_Utils_Ex::isBlank(SMTP_PASSWORD)) { - $arrParams['auth'] = true; + $arrParams['auth'] = "PLAIN"; $arrParams['username'] = SMTP_USER; $arrParams['password'] = SMTP_PASSWORD; } diff --git a/data/module/Net/Socket.php b/data/module/Net/Socket.php index 2fee65cd2c..d9edceef27 100644 --- a/data/module/Net/Socket.php +++ b/data/module/Net/Socket.php @@ -644,6 +644,7 @@ function enableCrypto($enabled, $type) if (!is_resource($this->fp)) { return $this->raiseError('not connected'); } + stream_context_set_option($this->fp, 'ssl', 'verify_peer_name', false); return @stream_socket_enable_crypto($this->fp, $enabled, $type); } else { $msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0'; From 43dfb92c003b320e6d108e6801d6979292e7e36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AE=E3=81=B6?= Date: Mon, 13 Jun 2022 18:12:44 +0900 Subject: [PATCH 16/16] =?UTF-8?q?test=E3=81=8C=E8=90=BD=E3=81=A1=E3=82=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_SendMail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/class/SC_SendMail.php b/data/class/SC_SendMail.php index aeb6236311..70c9228820 100644 --- a/data/class/SC_SendMail.php +++ b/data/class/SC_SendMail.php @@ -393,7 +393,7 @@ public function getBackendParams($backend) && defined('SMTP_PASSWORD') && !SC_Utils_Ex::isBlank(SMTP_USER) && !SC_Utils_Ex::isBlank(SMTP_PASSWORD)) { - $arrParams['auth'] = "PLAIN"; + $arrParams['auth'] = true; $arrParams['username'] = SMTP_USER; $arrParams['password'] = SMTP_PASSWORD; }