Skip to content

Add regression tests - #3268

Merged
Crabcyborg merged 2 commits into
masterfrom
add_regression_tests
Aug 21, 2026
Merged

Add regression tests#3268
Crabcyborg merged 2 commits into
masterfrom
add_regression_tests

Conversation

@Crabcyborg

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Crabcyborg, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 44968ca5-cff2-4b8e-837f-8f5f07a97304

📥 Commits

Reviewing files that changed from the base of the PR and between 83b374e and 717c82e.

📒 Files selected for processing (1)
  • tests/phpunit/entries/test_FrmEntryMeta.php

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Aug 21, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 83b374e...717c82e on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Aug 21, 2026 12:24a.m. Review ↗
JavaScript Aug 21, 2026 12:24a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@@ -53,6 +53,190 @@ public function test_update_entry_metas() {
$this->assertNull( $meta );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmEntryMeta::assertNull()


The method you are trying to call is not defined, which can result in a fatal error.

* @return array The form, the text field id and the number field id.
*/
private function create_text_and_number_fields() {
$form = $this->factory->form->create_and_get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmEntryMeta::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

private function create_text_and_number_fields() {
$form = $this->factory->form->create_and_get();

$text_field_id = $this->factory->field->create(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmEntryMeta::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

)
);

$number_field_id = $this->factory->field->create(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmEntryMeta::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

'meta_value' => 'abc',
);
$this->run_private_method( array( 'FrmEntryMeta', 'set_value_before_save' ), array( &$values, $as_number ) );
$this->assertEqualsWithDelta( 0.0, $values['meta_value'], PHP_FLOAT_EPSILON, 'The passed number field should coerce a non-numeric value to a float.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmEntryMeta::assertEqualsWithDelta()


The method you are trying to call is not defined, which can result in a fatal error.

)
);

$this->assertSame( 'abc', FrmEntryMeta::get_entry_meta_by_field( $entry_id, $text_field_id ), 'A newly inserted text value should be stored as typed.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmEntryMeta::assertSame()


The method you are trying to call is not defined, which can result in a fatal error.

);

$this->assertSame( 'abc', FrmEntryMeta::get_entry_meta_by_field( $entry_id, $text_field_id ), 'A newly inserted text value should be stored as typed.' );
$this->assertSame( '0', FrmEntryMeta::get_entry_meta_by_field( $entry_id, $number_field_id ), 'A newly inserted number value should be coerced to zero.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmEntryMeta::assertSame()


The method you are trying to call is not defined, which can result in a fatal error.

public function test_update_entry_metas_packs_values_keyed_by_field_key_with_the_resolved_field() {
list( $form, $text_field_id, $number_field_id ) = $this->create_text_and_number_fields();

$entry_id = $this->factory->entry->create( $this->factory->field->generate_entry_array( $form ) );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access to an undefined property test_FrmEntryMeta::$factory


The property you are trying to access is not defined and will cause unexpected behavior when used.

$stored_text = FrmEntryMeta::get_entry_meta_by_field( $entry_id, $text_field_id );
$stored_number = FrmEntryMeta::get_entry_meta_by_field( $entry_id, $number_field_id );

$this->assertSame( 'abc', $stored_text, 'A value keyed by field key should be packed with the text field it resolves to.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmEntryMeta::assertSame()


The method you are trying to call is not defined, which can result in a fatal error.

$stored_number = FrmEntryMeta::get_entry_meta_by_field( $entry_id, $number_field_id );

$this->assertSame( 'abc', $stored_text, 'A value keyed by field key should be packed with the text field it resolves to.' );
$this->assertSame( '0', $stored_number, 'A value keyed by field id alongside it should still be packed with the number field.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call to an undefined method test_FrmEntryMeta::assertSame()


The method you are trying to call is not defined, which can result in a fatal error.

@Crabcyborg
Crabcyborg merged commit cba4554 into master Aug 21, 2026
21 of 22 checks passed
@Crabcyborg
Crabcyborg deleted the add_regression_tests branch August 21, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant