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
| /** | ||
| * It should expose array schema definitions when reading the term configuration. | ||
| */ | ||
| public function test_get_term_schema_returns_array_definition() { | ||
| $term = wp_insert_term( 'Tipo Esquema', 'resolate_doc_type' ); | ||
| $term_id = intval( $term['term_id'] ); | ||
| $schema = $this->get_annex_schema(); | ||
| update_term_meta( $term_id, 'schema', $schema ); | ||
| update_term_meta( $term_id, 'resolate_type_fields', $schema ); | ||
|
|
||
| $result = Resolate_Documents::get_term_schema( $term_id ); | ||
|
|
||
| $this->assertNotEmpty( $result ); | ||
| $this->assertSame( 'annexes', $result[0]['slug'] ); | ||
| $this->assertSame( 'array', $result[0]['type'] ); | ||
| $this->assertSame( 'array', $result[0]['data_type'] ); | ||
| $this->assertArrayHasKey( 'item_schema', $result[0] ); | ||
| $this->assertArrayHasKey( 'number', $result[0]['item_schema'] ); | ||
| $this->assertSame( 'single', $result[0]['item_schema']['number']['type'] ); | ||
| $this->assertSame( 'Número', $result[0]['item_schema']['number']['label'] ); | ||
| } |
There was a problem hiding this comment.
Remove stray method outside test class
After the class closing brace, the file defines another public function test_get_term_schema_returns_array_definition() at global scope. PHP does not allow visibility keywords outside a class, so including this file throws a parse error (unexpected token "public") and will prevent the unit test suite from running. Move this test inside ResolateDocumentsArrayFieldsTest (or into a new class) to restore syntactically valid test code.
Useful? React with 👍 / 👎.
Summary
Testing
composer test -- tests/unit/includes/ResolateTemplateParserTest.php(fails: vendor/bin/phpunit not found in the container)https://chatgpt.com/codex/tasks/task_e_68ee30cf252083229149dd9f656091e1