Skip to content

Use wp tablename placeholder in db queries - #3223

Open
Crabcyborg wants to merge 3 commits into
masterfrom
use_wp_tablename_placeholder_in_db_queries
Open

Use wp tablename placeholder in db queries#3223
Crabcyborg wants to merge 3 commits into
masterfrom
use_wp_tablename_placeholder_in_db_queries

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Security

    • Improved database query safety by consistently using prepared identifier placeholders for table names.
  • Developer Tools

    • Added automated code checks to detect unsafe table-name interpolation and provide fixes where possible.
  • Tests

    • Expanded coverage for database migrations, form status updates, embedded forms, and query-safety validation.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e2e197e6-7356-424a-9bd0-ea8c7014cabd

📥 Commits

Reviewing files that changed from the base of the PR and between 2270c43 and 87325ac.

📒 Files selected for processing (14)
  • stripe/controllers/FrmTransLiteCRUDController.php
  • stripe/helpers/FrmTransLiteListHelper.php
  • stripe/models/FrmTransLiteDb.php
  • tests/phpunit/database/test_FrmDb.php
  • tests/phpunit/emails/test_FrmEmailSummaryHelper.php
  • tests/phpunit/entries/test_FrmEntryMeta.php
  • tests/phpunit/fields/test_FrmField.php
  • tests/phpunit/forms/test_FrmFormsListHelper.php
  • tests/phpunit/stripe/test_FrmStrpLiteEventsController.php
  • tests/phpunit/stripe/test_FrmTransLiteCRUDController.php
  • tests/phpunit/stripe/test_FrmTransLiteListHelper.php
  • tests/phpunit/stripe/test_FrmTransLiteSubscription.php
  • tests/phpunit/stripe/test_FrmTransLiteSubscriptionsController.php
  • tests/phpunit/styles/test_FrmStyle.php
📝 Walkthrough

Walkthrough

The pull request adds a PHPCS sniff for unsafe SQL table-identifier interpolation and converts core and Stripe queries to %i placeholders. PHPUnit tests cover the sniff, migrations, form status updates, and form-embed detection.

Changes

Identifier Placeholder Hardening

Layer / File(s) Summary
PHPCS identifier placeholder sniff
phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php, phpcs-sniffs/Formidable/ruleset.xml
Adds detection, diagnostics, exemptions, and automatic fixes for unsafe table identifiers in $wpdb queries.
Core query identifier conversion
classes/controllers/*, classes/helpers/*, classes/models/*
Updates core SQL queries to pass table names through %i placeholders.
Stripe query identifier conversion
stripe/controllers/*, stripe/models/*
Updates Stripe SQL queries to use %i placeholders for table identifiers.
Query migration and sniff tests
tests/phpunit/database/test_FrmMigrate.php, tests/phpunit/forms/test_FrmForm.php, tests/phpunit/misc/*
Adds coverage for migrations, form status changes, embed detection, and PHPCS sniff fixes and diagnostics.

Estimated code review effort: 4 (Complex) | ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.83% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: replacing interpolated table names with WordPress identifier placeholders in database queries.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch use_wp_tablename_placeholder_in_db_queries

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 6, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in e3ee649...87325ac 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 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php (1)

776-776: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the three unused parameters from apply_fix().

The body of apply_fix() uses $parts, $refs, and $args only. $openParen, $argEnd, and $closeParen are 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

📥 Commits

Reviewing files that changed from the base of the PR and between e3ee649 and 2270c43.

📒 Files selected for processing (21)
  • classes/controllers/FrmWelcomeTourController.php
  • classes/helpers/FrmEmailSummaryHelper.php
  • classes/helpers/FrmFormsListHelper.php
  • classes/models/FrmDb.php
  • classes/models/FrmEntry.php
  • classes/models/FrmEntryMeta.php
  • classes/models/FrmField.php
  • classes/models/FrmForm.php
  • classes/models/FrmMigrate.php
  • classes/models/FrmStyle.php
  • phpcs-sniffs/Formidable/Sniffs/Security/PreferIdentifierPlaceholderSniff.php
  • phpcs-sniffs/Formidable/ruleset.xml
  • stripe/controllers/FrmStrpLiteEventsController.php
  • stripe/controllers/FrmTransLiteSubscriptionsController.php
  • stripe/models/FrmTransLiteDb.php
  • stripe/models/FrmTransLiteSubscription.php
  • tests/phpunit/database/test_FrmMigrate.php
  • tests/phpunit/forms/test_FrmForm.php
  • tests/phpunit/misc/fixtures/prefer-identifier-placeholder-ruleset.xml
  • tests/phpunit/misc/test_FrmPreferIdentifierPlaceholderSniff.php
  • tests/phpunit/misc/test_FrmWelcomeTourController.php

Comment on lines +406 to +426
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 ),
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 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 );

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_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 );

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_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' ) );

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_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();

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_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();

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_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'] );

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_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 );

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_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 );

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_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(

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_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() );

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_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 );

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_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' ) );

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_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' ) );

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_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' ) );

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_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 ] );

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_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 );

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_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();

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_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 ) );

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_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 );

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_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 );

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_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 );

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_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' ) );

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_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' ) );

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_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' ) );

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_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 ] );

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_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 );

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_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();

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_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 ) );

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_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 );

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_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 );

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_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 );

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_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' ) );

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_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' ) );

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_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' ) );

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_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 ] );

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_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 );

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_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();

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_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 ) );

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_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 );

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_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 );

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_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 );

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_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' ) );

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_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' ) );

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_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' ) );

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_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 ] );

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_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 );

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_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();

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_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 ) );

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_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 );

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_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 );

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_FrmTransLiteListHelper::assertEquals()


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

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