Use wp tablename placeholder in db queries - #3223
Conversation
|
Warning Review limit reached
Next review available in: 7 minutes 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?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThe pull request adds a PHPCS sniff for unsafe SQL table-identifier interpolation and converts core and Stripe queries to ChangesIdentifier Placeholder Hardening
Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Aug 6, 2026 8:22p.m. | Review ↗ | |
| JavaScript | Aug 6, 2026 8:22p.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.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php (1)
776-776: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the three unused parameters from
apply_fix().The body of
apply_fix()uses$parts,$refs, and$argsonly.$openParen,$argEnd, and$closeParenare never read. PHPMD reports all three. Drop them from the signature and from the call site at Line 563.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php` at line 776, Update PreferIdentifierPlaceholderSniff::apply_fix() to remove the unused $openParen, $argEnd, and $closeParen parameters, and remove the corresponding arguments from its call site near line 563 while preserving the existing $parts, $refs, and $args usage.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php`:
- Around line 406-426: Mark the ref created in the unbalanced-backtick branch of
the matching loop in PreferIdentifierPlaceholderSniff as unfixable instead of
only reassigning $tickAfter. Update refs_are_fixable() to return false when any
ref has the unfixable marker, so apply_fix() cannot rewrite identifiers whose
closing backtick is in another part.
---
Nitpick comments:
In
`@phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php`:
- Line 776: Update PreferIdentifierPlaceholderSniff::apply_fix() to remove the
unused $openParen, $argEnd, and $closeParen parameters, and remove the
corresponding arguments from its call site near line 563 while preserving the
existing $parts, $refs, and $args usage.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e46d8bcb-63c5-4bbd-bba8-a4c2972307c4
📒 Files selected for processing (21)
classes/controllers/FrmWelcomeTourController.phpclasses/helpers/FrmEmailSummaryHelper.phpclasses/helpers/FrmFormsListHelper.phpclasses/models/FrmDb.phpclasses/models/FrmEntry.phpclasses/models/FrmEntryMeta.phpclasses/models/FrmField.phpclasses/models/FrmForm.phpclasses/models/FrmMigrate.phpclasses/models/FrmStyle.phpphpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.phpphpcs-sniffs/Formidable/ruleset.xmlstripe/controllers/FrmStrpLiteEventsController.phpstripe/controllers/FrmTransLiteSubscriptionsController.phpstripe/models/FrmTransLiteDb.phpstripe/models/FrmTransLiteSubscription.phptests/phpunit/database/test_FrmMigrate.phptests/phpunit/forms/test_FrmForm.phptests/phpunit/misc/fixtures/prefer-identifier-placeholder-ruleset.xmltests/phpunit/misc/test_FrmPreferIdentifierPlaceholderSniff.phptests/phpunit/misc/test_FrmWelcomeTourController.php
| foreach ( $matches[2] as $index => $match ) { | ||
| $text = $match[0]; | ||
| $tickBefore = $matches[1][ $index ][0]; | ||
| $tickAfter = $matches[3][ $index ][0]; | ||
| $startOffset = $matches[1][ $index ][1]; | ||
|
|
||
| if ( '' !== $tickBefore && '' === $tickAfter ) { | ||
| // Unbalanced backtick, the identifier continues in another part. Not safely fixable. | ||
| $tickAfter = ''; | ||
| } | ||
|
|
||
| $refs[] = array( | ||
| 'type' => 'in_string', | ||
| 'ptr' => $part['start'], | ||
| 'part' => $p, | ||
| 'offset' => $startOffset, | ||
| 'length' => strlen( $tickBefore ) + strlen( $text ) + strlen( $tickAfter ), | ||
| 'text' => $text, | ||
| 'expr' => $this->segments_to_expression( $text ), | ||
| ); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Unbalanced backticks are detected but still treated as fixable.
At Line 412 the code detects an identifier that starts with a backtick and does not close in the same string part. The comment states the case is not safely fixable. The code then assigns $tickAfter = '', which is the value it already holds, and still returns the ref as a normal in_string ref. refs_are_fixable() does not inspect this state, so apply_fix() replaces the opening backtick plus the matched text with %i and leaves the trailing backtick in a later part. The rewritten SQL then contains %i followed by a stray backtick.
Mark such refs as unfixable and let refs_are_fixable() reject them.
🐛 Proposed fix to block fixing for unbalanced backticks
foreach ( $matches[2] as $index => $match ) {
$text = $match[0];
$tickBefore = $matches[1][ $index ][0];
$tickAfter = $matches[3][ $index ][0];
$startOffset = $matches[1][ $index ][1];
-
- if ( '' !== $tickBefore && '' === $tickAfter ) {
- // Unbalanced backtick, the identifier continues in another part. Not safely fixable.
- $tickAfter = '';
- }
+ // Unbalanced backtick means the identifier continues in another part. Not safely fixable.
+ $unbalanced = '' !== $tickBefore && '' === $tickAfter;
$refs[] = array(
- 'type' => 'in_string',
- 'ptr' => $part['start'],
- 'part' => $p,
- 'offset' => $startOffset,
- 'length' => strlen( $tickBefore ) + strlen( $text ) + strlen( $tickAfter ),
- 'text' => $text,
- 'expr' => $this->segments_to_expression( $text ),
+ 'type' => 'in_string',
+ 'ptr' => $part['start'],
+ 'part' => $p,
+ 'offset' => $startOffset,
+ 'length' => strlen( $tickBefore ) + strlen( $text ) + strlen( $tickAfter ),
+ 'text' => $text,
+ 'unfixable' => $unbalanced,
+ 'expr' => $this->segments_to_expression( $text ),
);
}Then reject unfixable refs in refs_are_fixable():
foreach ( $refs as $ref ) {
if ( ! empty( $ref['unfixable'] ) ) {
return false;
}
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php`
around lines 406 - 426, Mark the ref created in the unbalanced-backtick branch
of the matching loop in PreferIdentifierPlaceholderSniff as unfixable instead of
only reassigning $tickAfter. Update refs_are_fixable() to return false when any
ref has the unfixable marker, so apply_fix() cannot rewrite identifiers whose
closing backtick is in another part.
|
|
||
| $this->assertNotFalse( $result ); | ||
| $this->assertEquals( 'published', FrmForm::getOne( $form_id_1 )->status ); | ||
| $this->assertEquals( 'published', FrmForm::getOne( $form_id_2 )->status ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmForm::assertEquals()
The method you are trying to call is not defined, which can result in a fatal error.
| $frmdb = new FrmMigrate(); | ||
| $this->run_private_method( array( $frmdb, 'migrate_to_23' ), array() ); | ||
|
|
||
| $this->assertSame( '', $wpdb->last_error ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmMigrate::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
| $this->run_private_method( array( $frmdb, 'migrate_to_23' ), array() ); | ||
|
|
||
| $this->assertSame( '', $wpdb->last_error ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_forms', 'parent_form_id' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmMigrate::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmForm::set_status | ||
| */ | ||
| public function test_set_status() { | ||
| $form_id_1 = $this->factory->form->create(); |
There was a problem hiding this comment.
Access to an undefined property test_FrmForm::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| */ | ||
| public function test_set_status() { | ||
| $form_id_1 = $this->factory->form->create(); | ||
| $form_id_2 = $this->factory->form->create(); |
There was a problem hiding this comment.
Access to an undefined property test_FrmForm::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| $this->assertNotEmpty( $errors, 'Expected the sniff to flag: ' . $code ); | ||
|
|
||
| foreach ( $errors as $error ) { | ||
| $this->assertSame( $source, $error['source'] ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmPreferIdentifierPlaceholderSniff::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| foreach ( $errors as $error ) { | ||
| $this->assertSame( $source, $error['source'] ); | ||
| $this->assertFalse( $error['fixable'], 'Expected a non-fixable error for: ' . $code ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmPreferIdentifierPlaceholderSniff::assertFalse()
The method you are trying to call is not defined, which can result in a fatal error.
| */ | ||
| private function assert_clean( $code ) { | ||
| $file = $this->process_code( $code ); | ||
| $this->assertSame( 0, $file->getErrorCount(), 'Expected no errors for: ' . $code ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmPreferIdentifierPlaceholderSniff::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
| public function test_check_for_form_embeds() { | ||
| $this->assertFalse( $this->check_for_form_embeds() ); | ||
|
|
||
| $this->factory->post->create( |
There was a problem hiding this comment.
Access to an undefined property test_FrmWelcomeTourController::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| ) | ||
| ); | ||
|
|
||
| $this->assertTrue( $this->check_for_form_embeds() ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmWelcomeTourController::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| @@ -24,4 +24,13 @@ public function test_esc_order() { | |||
| $this->assertSame( $expected, $actual ); | |||
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmDb::db_column_exists | ||
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); | ||
| $this->assertFalse( FrmDb::db_column_exists( 'frm_fields', 'missing_column' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertFalse()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertArrayHasKey( $form_a->id, $by_form ); | ||
| $this->assertArrayHasKey( $form_b->id, $by_form ); | ||
| $this->assertSame( 2, $by_form[ $form_a->id ] ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmEmailSummaryHelper::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertStringContainsString( 'FROM `' . $wpdb->prefix . 'frm_payments` p', $query ); | ||
| $this->assertStringContainsString( 'JOIN `' . $wpdb->prefix . 'frm_items` i ON p.item_id = i.id', $query ); | ||
| $this->assertStringContainsString( 'i.form_id = ' . $form_id, $query ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertStringContainsString()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmTransLiteListHelper::get_form_ids | ||
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); | ||
| $entry = $this->factory->entry->create_and_get( $this->factory->field->generate_entry_array( $form ) ); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
|
|
||
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertArrayHasKey()
The method you are trying to call is not defined, which can result in a fatal error.
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); | ||
| $this->assertEquals( $form->id, $form_ids[ $entry->id ]->form_id ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertEquals()
The method you are trying to call is not defined, which can result in a fatal error.
| @@ -24,4 +24,13 @@ public function test_esc_order() { | |||
| $this->assertSame( $expected, $actual ); | |||
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmDb::db_column_exists | ||
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); | ||
| $this->assertFalse( FrmDb::db_column_exists( 'frm_fields', 'missing_column' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertFalse()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertArrayHasKey( $form_a->id, $by_form ); | ||
| $this->assertArrayHasKey( $form_b->id, $by_form ); | ||
| $this->assertSame( 2, $by_form[ $form_a->id ] ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmEmailSummaryHelper::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertStringContainsString( 'FROM `' . $wpdb->prefix . 'frm_payments` p', $query ); | ||
| $this->assertStringContainsString( 'JOIN `' . $wpdb->prefix . 'frm_items` i ON p.item_id = i.id', $query ); | ||
| $this->assertStringContainsString( 'i.form_id = ' . $form_id, $query ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertStringContainsString()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmTransLiteListHelper::get_form_ids | ||
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); | ||
| $entry = $this->factory->entry->create_and_get( $this->factory->field->generate_entry_array( $form ) ); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
|
|
||
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertArrayHasKey()
The method you are trying to call is not defined, which can result in a fatal error.
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); | ||
| $this->assertEquals( $form->id, $form_ids[ $entry->id ]->form_id ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertEquals()
The method you are trying to call is not defined, which can result in a fatal error.
| @@ -24,4 +24,13 @@ public function test_esc_order() { | |||
| $this->assertSame( $expected, $actual ); | |||
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmDb::db_column_exists | ||
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); | ||
| $this->assertFalse( FrmDb::db_column_exists( 'frm_fields', 'missing_column' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertFalse()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertArrayHasKey( $form_a->id, $by_form ); | ||
| $this->assertArrayHasKey( $form_b->id, $by_form ); | ||
| $this->assertSame( 2, $by_form[ $form_a->id ] ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmEmailSummaryHelper::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertStringContainsString( 'FROM `' . $wpdb->prefix . 'frm_payments` p', $query ); | ||
| $this->assertStringContainsString( 'JOIN `' . $wpdb->prefix . 'frm_items` i ON p.item_id = i.id', $query ); | ||
| $this->assertStringContainsString( 'i.form_id = ' . $form_id, $query ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertStringContainsString()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmTransLiteListHelper::get_form_ids | ||
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); | ||
| $entry = $this->factory->entry->create_and_get( $this->factory->field->generate_entry_array( $form ) ); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
|
|
||
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertArrayHasKey()
The method you are trying to call is not defined, which can result in a fatal error.
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); | ||
| $this->assertEquals( $form->id, $form_ids[ $entry->id ]->form_id ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertEquals()
The method you are trying to call is not defined, which can result in a fatal error.
| @@ -24,4 +24,13 @@ public function test_esc_order() { | |||
| $this->assertSame( $expected, $actual ); | |||
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmDb::db_column_exists | ||
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| */ | ||
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertTrue()
The method you are trying to call is not defined, which can result in a fatal error.
| public function test_db_column_exists() { | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_fields', 'field_key' ) ); | ||
| $this->assertTrue( FrmDb::db_column_exists( 'frm_items', 'is_draft' ) ); | ||
| $this->assertFalse( FrmDb::db_column_exists( 'frm_fields', 'missing_column' ) ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmDb::assertFalse()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertArrayHasKey( $form_a->id, $by_form ); | ||
| $this->assertArrayHasKey( $form_b->id, $by_form ); | ||
| $this->assertSame( 2, $by_form[ $form_a->id ] ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmEmailSummaryHelper::assertSame()
The method you are trying to call is not defined, which can result in a fatal error.
|
|
||
| $this->assertStringContainsString( 'FROM `' . $wpdb->prefix . 'frm_payments` p', $query ); | ||
| $this->assertStringContainsString( 'JOIN `' . $wpdb->prefix . 'frm_items` i ON p.item_id = i.id', $query ); | ||
| $this->assertStringContainsString( 'i.form_id = ' . $form_id, $query ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertStringContainsString()
The method you are trying to call is not defined, which can result in a fatal error.
| * @covers FrmTransLiteListHelper::get_form_ids | ||
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
| */ | ||
| public function test_get_form_ids() { | ||
| $form = $this->factory->form->create_and_get(); | ||
| $entry = $this->factory->entry->create_and_get( $this->factory->field->generate_entry_array( $form ) ); |
There was a problem hiding this comment.
Access to an undefined property test_FrmTransLiteListHelper::$factory
The property you are trying to access is not defined and will cause unexpected behavior when used.
|
|
||
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertArrayHasKey()
The method you are trying to call is not defined, which can result in a fatal error.
| unset( $_REQUEST['trans_type'] ); | ||
|
|
||
| $this->assertArrayHasKey( $entry->id, $form_ids ); | ||
| $this->assertEquals( $form->id, $form_ids[ $entry->id ]->form_id ); |
There was a problem hiding this comment.
Call to an undefined method test_FrmTransLiteListHelper::assertEquals()
The method you are trying to call is not defined, which can result in a fatal error.
Summary by CodeRabbit
Security
Developer Tools
Tests