Add unit tests for annex array field handling#36
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
|
|
||
| $schema = Resolate_Template_Parser::build_schema_from_field_definitions( $fields ); | ||
|
|
There was a problem hiding this comment.
Avoid calling undefined schema builder
ResolateTemplateParserTest::test_build_schema_from_field_definitions_detects_arrays() invokes Resolate_Template_Parser::build_schema_from_field_definitions(), but Resolate_Template_Parser does not declare that method anywhere in includes/class-resolate-template-parser.php. Executing the test suite will therefore fatally error before the assertions run. The parser needs a matching API or the test should target an existing function so tests can execute.
Useful? React with 👍 / 👎.
| $items = array(); | ||
| for ( $i = 0; $i < Resolate_Documents::ARRAY_FIELD_MAX_ITEMS + 5; $i++ ) { | ||
| $items[] = array( | ||
| 'number' => 'N' . $i, | ||
| 'title' => 'Título ' . $i, | ||
| 'content' => 'Contenido ' . $i, |
There was a problem hiding this comment.
Undefined ARRAY_FIELD_MAX_ITEMS constant in tests
ResolateDocumentsArrayFieldsTest references Resolate_Documents::ARRAY_FIELD_MAX_ITEMS when creating and asserting annex entries, but the Resolate_Documents class defines no such constant anywhere in the codebase. Running the tests will immediately raise an "Undefined constant" fatal error. Introduce the constant on the class (or inline a literal value in the test) before relying on it.
Useful? React with 👍 / 👎.
Summary
Testing
composer test(fails: missing WordPress wp-tests-config.php in this environment)https://chatgpt.com/codex/tasks/task_e_68ee30cf252083229149dd9f656091e1