Skip to content

Commit 1223815

Browse files
authored
Merge pull request #6 from yajra/integration
test: integration with sqlldr to oracle db
2 parents 01a5d4e + bfd639a commit 1223815

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use Yajra\SQLLoader\SQLLoader;
4+
5+
use function Pest\Laravel\assertDatabaseCount;
6+
7+
test('it can load data to oracle table', function () {
8+
$count = DB::table('users')->count();
9+
10+
SQLLoader::make()
11+
->inFile(__DIR__.'/../data/users.dat')
12+
->withHeaders()
13+
->into('users')
14+
->execute();
15+
16+
assertDatabaseCount('users', $count + 4);
17+
})->skip(! file_exists('/usr/local/bin/sqlldr'), 'This test is skipped because it requires SQLLDR binary.');

tests/Pest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Illuminate\Foundation\Testing\RefreshDatabase;
1515
use Yajra\SQLLoader\Tests\TestCase;
1616

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

1919
/*
2020
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)