diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index 7ea000cd57a4..64956bb2324f 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -2276,7 +2276,7 @@ public function whereFullText($columns, $value, array $options = [], $boolean = */ public function orWhereFullText($columns, $value, array $options = []) { - return $this->whereFulltext($columns, $value, $options, 'or'); + return $this->whereFullText($columns, $value, $options, 'or'); } /** diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index 4e053c34cdf3..096b82450d25 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -1252,27 +1252,27 @@ public function testArrayWhereColumn() public function testWhereFulltextMySql() { $builder = $this->getMySqlBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World'); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World'); $this->assertSame('select * from `users` where match (`body`) against (? in natural language mode)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getMySqlBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World', ['expanded' => true]); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World', ['expanded' => true]); $this->assertSame('select * from `users` where match (`body`) against (? in natural language mode with query expansion)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getMySqlBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', '+Hello -World', ['mode' => 'boolean']); + $builder->select('*')->from('users')->whereFullText('body', '+Hello -World', ['mode' => 'boolean']); $this->assertSame('select * from `users` where match (`body`) against (? in boolean mode)', $builder->toSql()); $this->assertEquals(['+Hello -World'], $builder->getBindings()); $builder = $this->getMySqlBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', '+Hello -World', ['mode' => 'boolean', 'expanded' => true]); + $builder->select('*')->from('users')->whereFullText('body', '+Hello -World', ['mode' => 'boolean', 'expanded' => true]); $this->assertSame('select * from `users` where match (`body`) against (? in boolean mode)', $builder->toSql()); $this->assertEquals(['+Hello -World'], $builder->getBindings()); $builder = $this->getMySqlBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext(['body', 'title'], 'Car,Plane'); + $builder->select('*')->from('users')->whereFullText(['body', 'title'], 'Car,Plane'); $this->assertSame('select * from `users` where match (`body`, `title`) against (? in natural language mode)', $builder->toSql()); $this->assertEquals(['Car,Plane'], $builder->getBindings()); } @@ -1280,37 +1280,37 @@ public function testWhereFulltextMySql() public function testWhereFulltextPostgres() { $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World'); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World'); $this->assertSame('select * from "users" where (to_tsvector(\'english\', "body")) @@ plainto_tsquery(\'english\', ?)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World', ['language' => 'simple']); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World', ['language' => 'simple']); $this->assertSame('select * from "users" where (to_tsvector(\'simple\', "body")) @@ plainto_tsquery(\'simple\', ?)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World', ['mode' => 'plain']); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World', ['mode' => 'plain']); $this->assertSame('select * from "users" where (to_tsvector(\'english\', "body")) @@ plainto_tsquery(\'english\', ?)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World', ['mode' => 'phrase']); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World', ['mode' => 'phrase']); $this->assertSame('select * from "users" where (to_tsvector(\'english\', "body")) @@ phraseto_tsquery(\'english\', ?)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', '+Hello -World', ['mode' => 'websearch']); + $builder->select('*')->from('users')->whereFullText('body', '+Hello -World', ['mode' => 'websearch']); $this->assertSame('select * from "users" where (to_tsvector(\'english\', "body")) @@ websearch_to_tsquery(\'english\', ?)', $builder->toSql()); $this->assertEquals(['+Hello -World'], $builder->getBindings()); $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext('body', 'Hello World', ['language' => 'simple', 'mode' => 'plain']); + $builder->select('*')->from('users')->whereFullText('body', 'Hello World', ['language' => 'simple', 'mode' => 'plain']); $this->assertSame('select * from "users" where (to_tsvector(\'simple\', "body")) @@ plainto_tsquery(\'simple\', ?)', $builder->toSql()); $this->assertEquals(['Hello World'], $builder->getBindings()); $builder = $this->getPostgresBuilderWithProcessor(); - $builder->select('*')->from('users')->whereFulltext(['body', 'title'], 'Car Plane'); + $builder->select('*')->from('users')->whereFullText(['body', 'title'], 'Car Plane'); $this->assertSame('select * from "users" where (to_tsvector(\'english\', "body") || to_tsvector(\'english\', "title")) @@ plainto_tsquery(\'english\', ?)', $builder->toSql()); $this->assertEquals(['Car Plane'], $builder->getBindings()); } diff --git a/tests/Integration/Database/MariaDb/FulltextTest.php b/tests/Integration/Database/MariaDb/FulltextTest.php index e5ed54016358..82047b03ab8e 100644 --- a/tests/Integration/Database/MariaDb/FulltextTest.php +++ b/tests/Integration/Database/MariaDb/FulltextTest.php @@ -44,7 +44,7 @@ protected function setUp(): void /** @link https://mariadb.com/kb/en/full-text-index-overview/#in-natural-language-mode */ public function testWhereFulltext() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'database')->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'database')->get(); $this->assertCount(2, $articles); $this->assertSame('MariaDB Tutorial', $articles[0]->title); @@ -54,7 +54,7 @@ public function testWhereFulltext() /** @link https://mariadb.com/kb/en/full-text-index-overview/#in-boolean-mode */ public function testWhereFulltextWithBooleanMode() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], '+MariaDB -YourSQL', ['mode' => 'boolean'])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], '+MariaDB -YourSQL', ['mode' => 'boolean'])->get(); $this->assertCount(5, $articles); } @@ -62,7 +62,7 @@ public function testWhereFulltextWithBooleanMode() /** @link https://mariadb.com/kb/en/full-text-index-overview/#with-query-expansion */ public function testWhereFulltextWithExpandedQuery() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'database', ['expanded' => true])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'database', ['expanded' => true])->get(); $this->assertCount(6, $articles); } diff --git a/tests/Integration/Database/MySql/FulltextTest.php b/tests/Integration/Database/MySql/FulltextTest.php index f1ca3ce4da41..516f916c4354 100644 --- a/tests/Integration/Database/MySql/FulltextTest.php +++ b/tests/Integration/Database/MySql/FulltextTest.php @@ -44,7 +44,7 @@ protected function setUp(): void /** @link https://dev.mysql.com/doc/refman/8.0/en/fulltext-natural-language.html */ public function testWhereFulltext() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'database')->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'database')->get(); $this->assertCount(2, $articles); $this->assertSame('MySQL Tutorial', $articles[0]->title); @@ -54,7 +54,7 @@ public function testWhereFulltext() /** @link https://dev.mysql.com/doc/refman/8.0/en/fulltext-boolean.html */ public function testWhereFulltextWithBooleanMode() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], '+MySQL -YourSQL', ['mode' => 'boolean'])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], '+MySQL -YourSQL', ['mode' => 'boolean'])->get(); $this->assertCount(5, $articles); } @@ -62,7 +62,7 @@ public function testWhereFulltextWithBooleanMode() /** @link https://dev.mysql.com/doc/refman/8.0/en/fulltext-query-expansion.html */ public function testWhereFulltextWithExpandedQuery() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'database', ['expanded' => true])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'database', ['expanded' => true])->get(); $this->assertCount(6, $articles); } diff --git a/tests/Integration/Database/Postgres/FulltextTest.php b/tests/Integration/Database/Postgres/FulltextTest.php index beaa93803d1f..c8403ea728cf 100644 --- a/tests/Integration/Database/Postgres/FulltextTest.php +++ b/tests/Integration/Database/Postgres/FulltextTest.php @@ -44,7 +44,7 @@ protected function setUp(): void public function testWhereFulltext() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'database')->orderBy('id')->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'database')->orderBy('id')->get(); $this->assertCount(2, $articles); $this->assertSame('PostgreSQL Tutorial', $articles[0]->title); @@ -54,21 +54,21 @@ public function testWhereFulltext() #[RequiresDatabase('pgsql', '>=11.0')] public function testWhereFulltextWithWebsearch() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], '+PostgreSQL -YourSQL', ['mode' => 'websearch'])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], '+PostgreSQL -YourSQL', ['mode' => 'websearch'])->get(); $this->assertCount(5, $articles); } public function testWhereFulltextWithPlain() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'PostgreSQL tutorial', ['mode' => 'plain'])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'PostgreSQL tutorial', ['mode' => 'plain'])->get(); $this->assertCount(2, $articles); } public function testWhereFulltextWithPhrase() { - $articles = DB::table('articles')->whereFulltext(['title', 'body'], 'PostgreSQL tutorial', ['mode' => 'phrase'])->get(); + $articles = DB::table('articles')->whereFullText(['title', 'body'], 'PostgreSQL tutorial', ['mode' => 'phrase'])->get(); $this->assertCount(1, $articles); }