Skip to content

Commit

Permalink
Remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Sep 1, 2023
1 parent 1d0da2c commit 55ba461
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
if: matrix.database == 'sqlsrv'
- run: mysql -h 127.0.0.1 -u root -ptest -P ${{ job.services.singlestore.ports[3306] }} -e "create database test"
if: matrix.database == 'singlestore'
- run: composer update --no-interaction --no-progress --prefer-dist --prefer-${{ matrix.release }} --ignore-platform-req=ext-oci8
- run: composer update --no-interaction --no-progress --prefer-dist --prefer-${{ matrix.release }}
- run: cp tests/config/database.ci.php tests/config/database.php
- run: |
PHPUNIT_FLAGS=$([ "${{ matrix.coverage }}" == "xdebug" ] && echo "--coverage-clover=coverage.xml" || echo "")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- run: composer update --no-interaction --no-progress --prefer-dist --ignore-platform-req=ext-oci8
- run: composer update --no-interaction --no-progress --prefer-dist
- run: vendor/bin/phpstan analyse --error-format=github
5 changes: 1 addition & 4 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
build:
environment:
php:
version: 8.2
pecl_extensions:
- oci8
php: 8.2
tools:
external_code_coverage:
runs: 5
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.1",
"phpstan/phpstan": "^1.10",
"singlestoredb/singlestoredb-laravel": "^1.5.1",
"yajra/laravel-oci8": "^10.0"
"singlestoredb/singlestoredb-laravel": "^1.5.1"
},
"autoload": {
"psr-4": {
Expand Down
34 changes: 0 additions & 34 deletions tests/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Illuminate\Support\Facades\DB;
use Staudenmeir\LaravelCte\DatabaseServiceProvider;
use Staudenmeir\LaravelCte\Query\Builder;
use Staudenmeir\LaravelCte\Query\OracleBuilder;
use Staudenmeir\LaravelCte\Query\SingleStoreBuilder;

class QueryTest extends TestCase
Expand Down Expand Up @@ -83,19 +82,6 @@ public function testWithExpressionSqlServer()
$this->assertEquals($expected, $builder->toSql());
}

public function testWithExpressionOracle()
{
$builder = $this->getBuilder('Oracle');
$builder->select('u.id')
->from('u')
->withExpression('u', $this->getBuilder('Oracle')->from('users'))
->withExpression('p', $this->getBuilder('Oracle')->from('posts'))
->join('p', 'p.user_id', '=', 'u.id');

$expected = 'with "U" as (select * from "USERS"), "P" as (select * from "POSTS") select "U"."ID" from "U" inner join "P" on "P"."USER_ID" = "U"."ID"';
$this->assertEquals($expected, $builder->toSql());
}

public function testWithExpressionSingleStore()
{
$builder = $this->getBuilder('SingleStore');
Expand Down Expand Up @@ -216,25 +202,6 @@ public function testWithRecursiveExpressionSqlServer()
$this->assertEquals([3], $builder->getRawBindings()['expressions']);
}

public function testWithRecursiveExpressionOracle()
{
$query = $this->getBuilder('Oracle')
->selectRaw('1')
->unionAll(
$this->getBuilder('Oracle')
->selectRaw('number + 1')
->from('numbers')
->where('number', '<', 3)
);
$builder = $this->getBuilder('Oracle');
$builder->from('numbers')
->withRecursiveExpression('numbers', $query, ['number']);

$expected = 'with "NUMBERS" ("NUMBER") as ('.$query->toSql().') select * from "NUMBERS"';
$this->assertEquals($expected, $builder->toSql());
$this->assertEquals([3], $builder->getRawBindings()['expressions']);
}

public function testWithRecursiveExpressionSingleStore()
{
$query = $this->getBuilder('SingleStore')
Expand Down Expand Up @@ -553,7 +520,6 @@ protected function getBuilder($database)
$processor = $this->createMock(Processor::class);

return match ($database) {
'Oracle' => new OracleBuilder($connection, new $grammar(), $processor),
'SingleStore' => new SingleStoreBuilder($connection, new $grammar(), $processor),
default => new Builder($connection, new $grammar(), $processor),
};
Expand Down

0 comments on commit 55ba461

Please sign in to comment.