From 9f00115bd96d9cc686136fba08e3fa5c49c8d3b7 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 11 Sep 2013 18:45:34 +0000 Subject: [PATCH] Avoid the following notice: `Use of undefined constant term_id - assumed 'term_id'`, while running in debug mode. See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25356 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/query/results.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/query/results.php b/tests/phpunit/tests/query/results.php index 6c49e40d58..404aea6720 100644 --- a/tests/phpunit/tests/query/results.php +++ b/tests/phpunit/tests/query/results.php @@ -110,7 +110,7 @@ class Tests_Query_Results extends WP_UnitTestCase { function test_query_tag_id() { $tag = tag_exists('tag-a'); - $posts = $this->q->query("tag_id={$tag[term_id]}"); + $posts = $this->q->query( "tag_id=" . $tag['term_id'] ); // there are 4 posts with Tag A $this->assertCount( 4, $posts ); @@ -137,7 +137,7 @@ class Tests_Query_Results extends WP_UnitTestCase { function test_query_tag__in() { $tag_a = tag_exists('tag-a'); $tag_b = tag_exists('tag-b'); - $posts = $this->q->query("tag__in[]={$tag_a[term_id]}&tag__in[]={$tag_b[term_id]}"); + $posts = $this->q->query( "tag__in[]=". $tag_a['term_id'] . "&tag__in[]=" . $tag_b['term_id'] ); // there are 6 posts with either Tag A or Tag B $this->assertCount( 6, $posts ); @@ -151,7 +151,7 @@ class Tests_Query_Results extends WP_UnitTestCase { function test_query_tag__not_in() { $tag_a = tag_exists('tag-a'); - $posts = $this->q->query("tag__not_in[]={$tag_a[term_id]}"); + $posts = $this->q->query( "tag__not_in[]=" . $tag_a['term_id'] ); // the most recent 10 posts with Tag A excluded // (note the different between this and test_query_default) @@ -174,7 +174,7 @@ class Tests_Query_Results extends WP_UnitTestCase { function test_query_tag__in_but__not_in() { $tag_a = tag_exists('tag-a'); $tag_b = tag_exists('tag-b'); - $posts = $this->q->query("tag__in[]={$tag_a[term_id]}&tag__not_in[]={$tag_b[term_id]}"); + $posts = $this->q->query( "tag__in[]=" . $tag_a['term_id'] . "&tag__not_in[]=" . $tag_b['term_id'] ); // there are 4 posts with Tag A, only 2 when we exclude Tag B $this->assertCount( 2, $posts );