forked from jeroenzwart/laravel-csv-seeder
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…b actions to use database containers issue #17 make postgres sequence counter update more robust
- Loading branch information
Showing
22 changed files
with
532 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ composer.lock | |
.phpunit.result.cache | ||
.*.tmp | ||
~$*.xlsx | ||
.DS_Store | ||
|
||
examples/**/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name,email,email_verified_at,password | ||
Foo,[email protected],2019-01-23 21:38:54,password | ||
John,[email protected],2019-01-23 21:38:54,password | ||
id,name,email,email_verified_at,password,order | ||
1,Foo,[email protected],2019-01-23 21:38:54,password,10 | ||
5,John,[email protected],2019-01-23 21:38:54,password,3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="tests"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./app</directory> | ||
</include> | ||
</coverage> | ||
<php> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="BCRYPT_ROUNDS" value="4"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="DB_CONNECTION" value="sqlsrv"/> | ||
<env name="DB_DATABASE" value=""/> | ||
<env name="DB_HOST" value="127.0.0.1"/> | ||
<env name="DB_PORT" value="14330"/> | ||
<env name="DB_USERNAME" value="SA"/> | ||
<env name="DB_PASSWORD" value="MyPass@word"/> | ||
|
||
<!-- Set LARGE_ROWS_TESTS to "true" to run 15k and 100k tests --> | ||
<env name="LARGE_ROWS_TESTS" value="false"/> | ||
<env name="MAIL_MAILER" value="array"/> | ||
<env name="QUEUE_CONNECTION" value="sync"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="TELESCOPE_ENABLED" value="false"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace bfinlay\SpreadsheetSeeder\Support; | ||
|
||
use Illuminate\Support\Str; | ||
|
||
class StrMacros | ||
{ | ||
public static function registerBeforeLastMacro() { | ||
Str::macro('beforeLast', function($subject, $search) { | ||
if ($search === '') { | ||
return $subject; | ||
} | ||
|
||
$pos = mb_strrpos($subject, $search); | ||
|
||
if ($pos === false) { | ||
return $subject; | ||
} | ||
|
||
return static::substr($subject, 0, $pos); | ||
}); | ||
} | ||
|
||
public static function registerBetweenMacro() { | ||
Str::macro('between', function($subject, $from, $to) { | ||
if ($from === '' || $to === '') { | ||
return $subject; | ||
} | ||
|
||
return static::beforeLast(static::after($subject, $from), $to); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
|
||
namespace bfinlay\SpreadsheetSeeder\Tests\Seeds\SequenceTest; | ||
|
||
use bfinlay\SpreadsheetSeeder\SpreadsheetSeeder; | ||
use bfinlay\SpreadsheetSeeder\SpreadsheetSeederSettings; | ||
use bfinlay\SpreadsheetSeeder\Tests\Seeds\ParsersTest\UsersCsvParsersSeeder; | ||
|
||
class Users2AccountSeeder extends UsersCsvParsersSeeder | ||
{ | ||
public function settings(SpreadsheetSeederSettings $set) | ||
{ | ||
parent::settings($set); | ||
$set->tablename = 'users2_account'; | ||
$set->aliases = []; // settings are global singleton for request so need to be reset. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
|
||
namespace bfinlay\SpreadsheetSeeder\Tests\Seeds\SequenceTest; | ||
|
||
use bfinlay\SpreadsheetSeeder\SpreadsheetSeeder; | ||
use bfinlay\SpreadsheetSeeder\SpreadsheetSeederSettings; | ||
use bfinlay\SpreadsheetSeeder\Tests\Seeds\ParsersTest\UsersCsvParsersSeeder; | ||
|
||
class Users2Seeder extends UsersCsvParsersSeeder | ||
{ | ||
public function settings(SpreadsheetSeederSettings $set) | ||
{ | ||
parent::settings($set); | ||
$set->tablename = 'users2'; | ||
$set->aliases = ['id' => 'account_id']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
|
||
namespace bfinlay\SpreadsheetSeeder\Tests\Seeds\SequenceTest; | ||
|
||
use bfinlay\SpreadsheetSeeder\SpreadsheetSeeder; | ||
use bfinlay\SpreadsheetSeeder\SpreadsheetSeederSettings; | ||
use bfinlay\SpreadsheetSeeder\Tests\Seeds\ParsersTest\UsersCsvParsersSeeder; | ||
|
||
class Users3Seeder extends UsersCsvParsersSeeder | ||
{ | ||
public function settings(SpreadsheetSeederSettings $set) | ||
{ | ||
parent::settings($set); | ||
$set->tablename = 'users3'; | ||
$set->aliases = []; // settings are global singleton for request so need to be reset. | ||
} | ||
} |
Oops, something went wrong.