diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000000..6f18324104 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,63 @@ +name: PHP Composer + +on: + push: + branches: [ '**' ] + pull_request: + branches: [ '**' ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '5.3', '5.4', '7.0', '7.1' ] + db: [ mysql, pgsql ] + include: + - db: mysql + database_url: mysql://root:password@127.0.0.1:3306/eccube_db + - db: pgsql + database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db + services: + mysql: + image: mysql:5.5 + env: + MYSQL_ROOT_PASSWORD: password + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + postgres: + image: postgres:9 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: password + ports: + - 5432:5432 + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - uses: actions/checkout@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + - name: Setup Composer + run: | + composer self-update --1 + composer install + - name: Setup EC-CUBE + run: | + php eccube_install.php $DB none #26行目でcomposerインストールしているためスキップ + env: + DB: ${{ matrix.db }} + DATABASE_URL: ${{ matrix.database_url }} + - name: Php Unit Test + run: | + vendor/bin/phpunit + diff --git a/src/Eccube/Form/Type/Admin/ProductType.php b/src/Eccube/Form/Type/Admin/ProductType.php index 57b9856c55..b932b5f713 100644 --- a/src/Eccube/Form/Type/Admin/ProductType.php +++ b/src/Eccube/Form/Type/Admin/ProductType.php @@ -177,7 +177,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @param $form FormInterface * @param $dirs array */ - private function validateFilePath($form, $dirs) + public function validateFilePath($form, $dirs) { foreach ($form->getData() as $fileName) { if (strpos($fileName, '..') !== false) {