From 804d27e1cec0ebea1037666382813c85730883e1 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 29 Jan 2020 15:45:43 +0900 Subject: [PATCH 1/6] =?UTF-8?q?install=20=E3=83=95=E3=82=A9=E3=83=AB?= =?UTF-8?q?=E3=83=80=E3=81=AE=E5=89=8A=E9=99=A4=E3=82=92=E4=BF=83=E3=81=99?= =?UTF-8?q?=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctests/acceptance/InstallerCept.php | 25 +++++++++++++++++++++++++ data/class/util/SC_Utils.php | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ctests/acceptance/InstallerCept.php b/ctests/acceptance/InstallerCept.php index e32b150334..2eef6dbb03 100644 --- a/ctests/acceptance/InstallerCept.php +++ b/ctests/acceptance/InstallerCept.php @@ -76,3 +76,28 @@ $I->click(['css' => '.btn-tool-format']); $I->see('ログイン : 管理者 様'); + +$I->expect('TOPページを確認します'); +$I->seeInCurrentUrl('/'); +$I->see('インストール完了後に /install フォルダを削除してください。'); + +$I->expect('/install/index.php を削除します'); +unlink(HTML_REALDIR.'install/'.DIR_INDEX_FILE); +$I->seeInCurrentUrl('/'); +$I->see('インストール完了後に /install フォルダを削除してください。'); + +$I->expect('/install を削除します'); +$install_dir = __DIR__.'/../../install'; +$files = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($install_dir, FilesystemIterator::SKIP_DOTS), + RecursiveIteratorIterator::CHILD_FIRST +); +foreach ($files as $file) { + /** @var SplFileInfo $file */ + $file->isDir() ? rmdir($file->getPathname()) : unlink($file->getRealPath()); +} +rmdir($install_dir); + +$I->expect('/install が削除されていることを確認します'); +$I->seeInCurrentUrl('/'); +$I->dontSee('インストール完了後に /install フォルダを削除してください。'); diff --git a/data/class/util/SC_Utils.php b/data/class/util/SC_Utils.php index 9ce2601576..b340ecc9f6 100755 --- a/data/class/util/SC_Utils.php +++ b/data/class/util/SC_Utils.php @@ -45,9 +45,9 @@ public static function sfInitInstall() header('Location: ' . $install_url); exit; } - $path = HTML_REALDIR . 'install/' . DIR_INDEX_FILE; + $path = HTML_REALDIR . 'install'; if (file_exists($path)) { - SC_Utils_Ex::sfErrorHeader('>> /install/' . DIR_INDEX_FILE . ' は、インストール完了後にファイルを削除してください。'); + SC_Utils_Ex::sfErrorHeader('>> インストール完了後に /install フォルダを削除してください。'); } } From cedf95003971e4ff4940033cc096553bd80e45f0 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 29 Jan 2020 15:54:48 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=BC=E3=83=A9=E3=81=AE=20E2E=20=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8ddda0dc65..bba09bde32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,6 +90,7 @@ script: - if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env chrome --skip-group installer --steps ; fi - sed -e 's|http://|https://|g' -i.bak data/config/config.php - if [ ! $COVERAGE ] ; then php data/vendor/bin/phpunit -c phpunit.xml.dist tests/class/SC_SessionFactoryTest.php ; fi + - if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env chrome --group installer --steps ; fi after_script: - if [ $COVERAGE ] ; then php data/vendor/bin/coveralls -v ; fi From 0bdb6ace9651640169164fa81c9504e7279ebd26 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 29 Jan 2020 16:21:55 +0900 Subject: [PATCH 3/6] =?UTF-8?q?DB=20=E3=82=92=E4=BD=9C=E3=82=8A=E7=9B=B4?= =?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index bba09bde32..e58698f213 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,6 +90,9 @@ script: - if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env chrome --skip-group installer --steps ; fi - sed -e 's|http://|https://|g' -i.bak data/config/config.php - if [ ! $COVERAGE ] ; then php data/vendor/bin/phpunit -c phpunit.xml.dist tests/class/SC_SessionFactoryTest.php ; fi + - rm ./data/config/config.php + - if [ $DB = 'pgsql' ] ; then psql -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -c "DROP DATABASE ${DBNAME};"; psql -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -c "CREATE DATABASE ${DBNAME};" ; fi + - if [ $DB = 'mysql' ] ; then mysql -u root -h ${DBSERVER} -P ${DBPORT} --password=${DBPASS} -e "DROP DATABASE \`${DBNAME}\`"; mysql -u root -h ${DBSERVER} -P ${DBPORT} --password=${DBPASS} -e "CREATE DATABASE \`${DBNAME}\` DEFAULT COLLATE=utf8_general_ci;" ; fi - if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env chrome --group installer --steps ; fi after_script: From 2ba7fe61829cace13c689a3f0b06d99dbca5cc95 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 29 Jan 2020 16:47:40 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=A0=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E3=82=92=E5=BB=B6=E9=95=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctests/acceptance/InstallerCept.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctests/acceptance/InstallerCept.php b/ctests/acceptance/InstallerCept.php index 2eef6dbb03..ff7190292e 100644 --- a/ctests/acceptance/InstallerCept.php +++ b/ctests/acceptance/InstallerCept.php @@ -58,8 +58,8 @@ $I->click('次へ進む'); $I->see('データベースの初期化'); -$I->waitForText('○:テーブルの作成に成功しました。', 30); -$I->waitForText('○:シーケンスの作成に成功しました。', 30); +$I->waitForText('○:テーブルの作成に成功しました。', 60); +$I->waitForText('○:シーケンスの作成に成功しました。', 60); $I->click('次へ進む'); $I->expect('STEP4'); From f85822514fe2a82a47bc7fecff07ba21861dc8ef Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 29 Jan 2020 16:47:54 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Travis=20=E3=81=AE=20mysql=20=E3=81=AF?= =?UTF-8?q?=E3=83=91=E3=82=B9=E3=83=AF=E3=83=BC=E3=83=89=E3=81=8C=E7=A9=BA?= =?UTF-8?q?=E3=81=AA=E3=81=AE=E3=81=A7=E3=82=B9=E3=82=AD=E3=83=83=E3=83=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e58698f213..041e957210 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,8 +92,8 @@ script: - if [ ! $COVERAGE ] ; then php data/vendor/bin/phpunit -c phpunit.xml.dist tests/class/SC_SessionFactoryTest.php ; fi - rm ./data/config/config.php - if [ $DB = 'pgsql' ] ; then psql -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -c "DROP DATABASE ${DBNAME};"; psql -h ${DBSERVER} -U ${DBUSER} -p ${DBPORT} -c "CREATE DATABASE ${DBNAME};" ; fi - - if [ $DB = 'mysql' ] ; then mysql -u root -h ${DBSERVER} -P ${DBPORT} --password=${DBPASS} -e "DROP DATABASE \`${DBNAME}\`"; mysql -u root -h ${DBSERVER} -P ${DBPORT} --password=${DBPASS} -e "CREATE DATABASE \`${DBNAME}\` DEFAULT COLLATE=utf8_general_ci;" ; fi - - if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env chrome --group installer --steps ; fi + ## Travis の mysql はパスワードが空なのでスキップ + - if [ ! $COVERAGE ] && [ $DB = 'pgsql' ] ; then php data/vendor/bin/codecept run --env chrome --group installer --steps ; fi after_script: - if [ $COVERAGE ] ; then php data/vendor/bin/coveralls -v ; fi From 5b5ae1659abd23ae0e53d48fea31931c5aef592f Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 29 Jan 2020 17:14:28 +0900 Subject: [PATCH 6/6] =?UTF-8?q?DBPORT=20=E8=BF=BD=E5=8A=A0,=20TOP=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AE=E7=A2=BA=E8=AA=8D=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 26 +++++++++++++------------- ctests/acceptance/InstallerCept.php | 11 ++++++----- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 041e957210..b1a5118557 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,42 +21,42 @@ env: global: - DBNAME=myapp_test DBSERVER=127.0.0.1 HTTP_URL=http://localhost:8085/ HTTPS_URL=http://localhost:8085/ matrix: - - DB=mysql USER=root DBPASS=' ' DBUSER=root - - DB=pgsql USER=postgres DBPASS=password DBUSER=postgres - - DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true # Use for coverage report + - DB=mysql USER=root DBPASS=' ' DBUSER=root DBPORT=3306 + - DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 + - DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true # Use for coverage report matrix: fast_finish: true include: - php: 5.4 dist: trusty - env: DB=mysql USER=root DBPASS=' ' DBUSER=root DIST=trusty + env: DB=mysql USER=root DBPASS=' ' DBUSER=root DBPORT=3306 DIST=trusty - php: 5.4 dist: trusty - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DIST=trusty + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 DIST=trusty - php: 5.5 dist: trusty - env: DB=mysql USER=root DBPASS=' ' DBUSER=root DIST=trusty + env: DB=mysql USER=root DBPASS=' ' DBUSER=root DBPORT=3306 DIST=trusty - php: 5.5 dist: trusty - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DIST=trusty + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 DIST=trusty exclude: - php: 5.4 - php: 5.5 - php: 5.6 - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true - php: 7.0 - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true - php: 7.1 - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true - php: 7.2 - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true - php: 7.4 - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true allow_failures: # Use for coverage report - php: 7.3 - env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true + env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres DBPORT=5432 COVERAGE=true before_install: - if [[ $DIST = 'trusty' ]]; then sudo apt-get -y install google-chrome-stable --allow-unauthenticated ; fi diff --git a/ctests/acceptance/InstallerCept.php b/ctests/acceptance/InstallerCept.php index ff7190292e..f0884114bd 100644 --- a/ctests/acceptance/InstallerCept.php +++ b/ctests/acceptance/InstallerCept.php @@ -58,6 +58,7 @@ $I->click('次へ進む'); $I->see('データベースの初期化'); +$I->dontSee('×:テーブルの作成に失敗しました。'); $I->waitForText('○:テーブルの作成に成功しました。', 60); $I->waitForText('○:シーケンスの作成に成功しました。', 60); $I->click('次へ進む'); @@ -78,16 +79,16 @@ $I->see('ログイン : 管理者 様'); $I->expect('TOPページを確認します'); -$I->seeInCurrentUrl('/'); +$I->click(['id' => 'logo']); $I->see('インストール完了後に /install フォルダを削除してください。'); $I->expect('/install/index.php を削除します'); -unlink(HTML_REALDIR.'install/'.DIR_INDEX_FILE); -$I->seeInCurrentUrl('/'); +$install_dir = __DIR__.'/../../html/install'; +unlink($install_dir.'/'.DIR_INDEX_FILE); +$I->click(['id' => 'logo']); $I->see('インストール完了後に /install フォルダを削除してください。'); $I->expect('/install を削除します'); -$install_dir = __DIR__.'/../../install'; $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($install_dir, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST @@ -99,5 +100,5 @@ rmdir($install_dir); $I->expect('/install が削除されていることを確認します'); -$I->seeInCurrentUrl('/'); +$I->click(['id' => 'logo']); $I->dontSee('インストール完了後に /install フォルダを削除してください。');