Skip to content

Automated tests for the git integration - #24

Merged
codeling merged 5 commits into
mainfrom
claude/vibrant-turing-ry9q8d
Oct 3, 2026
Merged

codeling merged 5 commits into
mainfrom
claude/vibrant-turing-ry9q8d

Conversation

@codeling

@codeling codeling commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Closes #15

Tests

  • AppServer gets the options git, gitRemote (local bare origin) and pagesFolder (e.g. a path with spaces and quotes as PAGES_PATH); new base class GitTestCase.
  • New classes GitCommitTest, GitPushTest, GitPushWithoutRemoteTest, GitSpecialPathTest, GitDisabledTest, GitNoRepositoryTest: commits for page/image actions, literal storage of quotes, $(), backticks, newlines and non-ASCII text, pushes, generic errors without paths or commands (details in the error log), disabled commits, no repository, and the editor's "Message" field.

Fixes found by the tests

  • A failed save always redirected to the page, so the editor's title, text and git message were lost (the code to show the form again was never reached). The editor is now shown again with the error.
  • Renaming or deleting a page that doesn't exist logged PHP warnings; it now fails early.
  • Image rename/delete used the HTML note as the commit message; it is now plain text, e.g. Image deleted: a.gif (Updated images in the following pages: Gallery).

Existing tests that expected a redirect after a failed save were adapted (noteInResponse()). CLAUDE.md documents how to run the tests.

Not changed: page rename/delete commit messages still contain HTML-escaped page names (e.g. &).

Full suite: 574 tests pass (47 skipped, mostly SVG without the optional library).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ehe41umfi7BKegrSi4iuEB


Generated by Claude Code

claude added 5 commits October 3, 2026 18:38
Extend AppServer with the options git, gitRemote and pagesFolder, and test
commits, pushes, shell escaping, generic errors and the editor's Message field.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ehe41umfi7BKegrSi4iuEB
… missing pages

A failed save redirected to the page, so the form (title, text, git message)
was lost although the code to show it again existed. Renaming or deleting a
page which doesn't exist now fails early instead of logging PHP warnings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ehe41umfi7BKegrSi4iuEB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ehe41umfi7BKegrSi4iuEB
@codeling
codeling merged commit 741959c into main Oct 3, 2026
15 checks passed
@codeling
codeling deleted the claude/vibrant-turing-ry9q8d branch October 3, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated tests for the git integration (GIT_COMMIT_ENABLED / GIT_PUSH_ENABLED)

2 participants