From ced17175db769784d5bc029d1e792941a43ff7fa Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 22 Dec 2023 23:34:29 -0500 Subject: [PATCH] test: rename test --- ....php => LaravelDatabaseExpressionsRectorTest.php} | 4 ++-- tests/fixture/SkipRuleTestFixture.php.inc | 8 +------- tests/fixture/TestFixture.php.inc | 12 ++++++++++++ 3 files changed, 15 insertions(+), 9 deletions(-) rename tests/{ExampleRectorTest.php => LaravelDatabaseExpressionsRectorTest.php} (79%) diff --git a/tests/ExampleRectorTest.php b/tests/LaravelDatabaseExpressionsRectorTest.php similarity index 79% rename from tests/ExampleRectorTest.php rename to tests/LaravelDatabaseExpressionsRectorTest.php index 5ee2310..1d19d2c 100644 --- a/tests/ExampleRectorTest.php +++ b/tests/LaravelDatabaseExpressionsRectorTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Remarkablemark\Tests\RectorExample; +namespace Remarkablemark\Tests\RectorLaravelDatabaseExpressions; use PHPUnit\Framework\Attributes\DataProvider; use Rector\Testing\PHPUnit\AbstractRectorTestCase; @@ -12,7 +12,7 @@ * * @coversNothing */ -final class ExampleRectorTest extends AbstractRectorTestCase +final class LaravelDatabaseExpressionsRectorTest extends AbstractRectorTestCase { /** * @dataProvider provideCases diff --git a/tests/fixture/SkipRuleTestFixture.php.inc b/tests/fixture/SkipRuleTestFixture.php.inc index 09884d2..82451e1 100644 --- a/tests/fixture/SkipRuleTestFixture.php.inc +++ b/tests/fixture/SkipRuleTestFixture.php.inc @@ -19,13 +19,7 @@ function select5() { $db->select('select 5'); } -DB::select(DB::raw('select 6')); - -DB::select( - DB::raw('select 7') -); - -$db->select(DB::raw('select 8')); +$db->select(DB::raw('select 6')); $orders = DB::table('orders') ->select('department', DB::raw('SUM(price) as total_sales')) diff --git a/tests/fixture/TestFixture.php.inc b/tests/fixture/TestFixture.php.inc index 5b05254..4048e73 100644 --- a/tests/fixture/TestFixture.php.inc +++ b/tests/fixture/TestFixture.php.inc @@ -4,6 +4,12 @@ declare(strict_types=1); use Illuminate\Support\Facades\DB; +DB::select(DB::raw('select 1')); + +DB::select( + DB::raw('select 2') +); + $orders = DB::table('orders') ->selectRaw(DB::raw('price * ? as price_with_tax'), [1.0825]) ->get(); @@ -18,6 +24,12 @@ declare(strict_types=1); use Illuminate\Support\Facades\DB; +DB::select(DB::raw('select 1')); + +DB::select( + DB::raw('select 2') +); + $orders = DB::table('orders') ->selectRaw(DB::raw('price * ? as price_with_tax')->getValue(DB::getQueryGrammar()), [1.0825]) ->get();