Skip to content

Commit

Permalink
Merge pull request #6 from yajra/integration
Browse files Browse the repository at this point in the history
test: integration with sqlldr to oracle db
  • Loading branch information
yajra authored Jun 28, 2024
2 parents 01a5d4e + bfd639a commit 1223815
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions tests/Integration/SQLLoaderIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use Yajra\SQLLoader\SQLLoader;

use function Pest\Laravel\assertDatabaseCount;

test('it can load data to oracle table', function () {
$count = DB::table('users')->count();

SQLLoader::make()
->inFile(__DIR__.'/../data/users.dat')
->withHeaders()
->into('users')
->execute();

assertDatabaseCount('users', $count + 4);
})->skip(! file_exists('/usr/local/bin/sqlldr'), 'This test is skipped because it requires SQLLDR binary.');
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Yajra\SQLLoader\Tests\TestCase;

uses(TestCase::class, RefreshDatabase::class)->in('Feature');
uses(TestCase::class, RefreshDatabase::class)->in('Feature', 'Integration');

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 1223815

Please sign in to comment.