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" diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 92259a1d2e..2267bffa42 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/ @@ -58,11 +64,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/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/data/class/SC_ClassAutoloader.php b/data/class/SC_ClassAutoloader.php index 9ed4dd2c63..323cfd672a 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' && !in_array($arrClassNamePart[3], ['Home', 'Index', 'Logout'])) { + $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') { diff --git a/data/class/SC_SendMail.php b/data/class/SC_SendMail.php index d7e8b6a145..70c9228820 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; 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'; 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; 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 1d9496f82e..50565cba3c 100644 --- a/e2e-tests/test/admin/total/total.test.ts +++ b/e2e-tests/test/admin/total/total.test.ts @@ -309,4 +309,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..5ed3d3ca7f 100644 --- a/package.json +++ b/package.json @@ -7,16 +7,16 @@ "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", "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", - "webpack": "^5.69.1" + "webpack": "^5.73.0" }, "devDependencies": { "@babel/core": "^7.17.5", @@ -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/Common_TestCase.php b/tests/class/Common_TestCase.php index 01c5b2dcf1..f3e006a132 100644 --- a/tests/class/Common_TestCase.php +++ b/tests/class/Common_TestCase.php @@ -74,9 +74,13 @@ protected function verify($message = null) 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 +94,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 +116,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); } /** @@ -116,14 +125,11 @@ 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'); - - $message = json_decode($response->getBody(true), true); + $source = file_get_contents(self::MAILCATCHER_URL. '/messages/'.$message['id'].'.source'); - $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 +147,7 @@ protected function getLastMailCatcherMessage() } $last = array_shift($messages); - return $this->getMailCatcherMessage($last['id']); + return $this->getMailCatcherMessage($last); } 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(); + } +} 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'); diff --git a/yarn.lock b/yarn.lock index 9e5318ee31..b22341cd5d 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" @@ -1837,13 +1842,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" @@ -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" @@ -2864,10 +2869,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" @@ -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" @@ -3137,10 +3142,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 +3439,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" @@ -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: