Skip to content

Commit 2889c47

Browse files
Fix Naming to match Cypress tests & Cypress configuration
1 parent 7755c0f commit 2889c47

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.devcontainer/post-create.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ DB_NAME="test_joomla"
1010
DB_USER="joomla_ut"
1111
DB_PASS="joomla_ut"
1212
ADMIN_USER="ci-admin"
13-
ADMIN_REAL_NAME="john doe"
13+
ADMIN_REAL_NAME="jane doe"
1414
ADMIN_PASS="joomla-17082005"
15-
ADMIN_EMAIL="admin@example.org"
15+
ADMIN_EMAIL="admin@example.com"
1616
JOOMLA_ROOT="/workspaces/joomla-cms"
1717

1818
# Allow git commands to run safely in the container
@@ -34,7 +34,7 @@ echo "✅ Dependencies installed."
3434
# --- 3. Install Joomla from Repository Source ---
3535
echo "--> Installing Joomla using the local repository source..."
3636
php installation/joomla.php install \
37-
--site-name="Joomla Core Dev" \
37+
--site-name="Joomla CMS Test" \
3838
--admin-user="$ADMIN_REAL_NAME" \
3939
--admin-username="$ADMIN_USER" \
4040
--admin-password="$ADMIN_PASS" \
@@ -52,7 +52,7 @@ echo "✅ Joomla installed."
5252
# --- 4. Configure Joomla for Development ---
5353
echo "--> Applying development settings..."
5454
# Enable debug mode and maximum error reporting for easier troubleshooting.
55-
php cli/joomla.php config:set debug=true error_reporting=maximum
55+
php cli/joomla.php config:set error_reporting=maximum
5656
echo "✅ Development settings applied."
5757

5858
# --- 5. Install and Configure phpMyAdmin ---
@@ -90,6 +90,8 @@ echo "--> Ignoring local changes..."
9090
git update-index --assume-unchanged "index.php"
9191
git update-index --assume-unchanged "administrator/index.php"
9292
git update-index --assume-unchanged "package-lock.json"
93+
git update-index --assume-unchanged "tests/System/integration/install/Installation.cy.js"
94+
git update-index --assume-unchanged "tests/System/support/commands/config.mjs"
9395

9496
# For NEW UNTRACKED files, add them to the local exclude file
9597
echo "cypress.config.js" >> ".git/info/exclude"
@@ -100,9 +102,16 @@ echo "codespace-details.txt" >> ".git/info/exclude"
100102

101103
# --- 7. Finalize Permissions and Testing Tools ---
102104
echo "--> Setting up file permissions and Cypress..."
105+
sed -i \
106+
-e "/\/\/ If exists, delete PHP configuration file to force a new installation/d" \
107+
-e "/cy.task('deleteRelativePath', 'configuration.php');/d" \
108+
-e "/cy.installJoomla(config);/d" \
109+
tests/System/integration/install/Installation.cy.js
110+
sed -i "s/return cy.task('writeRelativeFile', { path: 'configuration.php', content });/return cy.task('writeRelativeFile', { path: 'configuration.php', content, mode: 0o775 });/" tests/System/support/commands/config.mjs
111+
103112
# Ensure Cypress is executable and owned by the web server user
104-
cp cypress.config.dist.mjs cypress.config.js
105113
chmod +x ./node_modules/.bin/cypress
114+
cp cypress.config.dist.mjs cypress.config.js
106115
npx cypress install
107116
sed -i -e "s|baseUrl:.*|baseUrl: 'http://localhost:80',|" -e "s/db_host: 'localhost'/db_host: 'mysql'/g" -e "s/db_user: 'root'/db_user: 'joomla_ut'/g" -e "s/db_password: ''/db_password: 'joomla_ut'/g" cypress.config.js
108117

0 commit comments

Comments
 (0)