Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dependabot/github…
Browse files Browse the repository at this point in the history
…_actions/actions/checkout-3
  • Loading branch information
nanasess committed Aug 5, 2022
2 parents 6257383 + c8b4836 commit 1fc24d3
Show file tree
Hide file tree
Showing 21 changed files with 293 additions and 334 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
strategy:
fail-fast: false
matrix:
pattern:
- 'test:e2e'
- 'test:e2e-extends'
group:
- 'test/front_login'
- 'test/front_guest'
Expand All @@ -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/
Expand All @@ -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()
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
248 changes: 2 additions & 246 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion data/class/SC_ClassAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
12 changes: 1 addition & 11 deletions data/module/Net/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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;
Expand Down
22 changes: 22 additions & 0 deletions e2e-tests/test/admin/customer/edit.test.ts
Original file line number Diff line number Diff line change
@@ -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(/カスタマイズ/);
});
});
Loading

0 comments on commit 1fc24d3

Please sign in to comment.