Skip to content

Commit

Permalink
Merge pull request #169 from dinandmentink/master
Browse files Browse the repository at this point in the history
Hey guys, sorry for waiting for so long, finally found some time to test & merge. Good work @dinandmentink and thanks for the effort!
  • Loading branch information
tihomiro authored Dec 14, 2020
2 parents 03c73d3 + 4599ed3 commit a6c54d2
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Orangehill/Iseed/Iseed.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function generateClassName($table, $prefix=null, $suffix=null)
*/
public function getStubPath()
{
return __DIR__ . DIRECTORY_SEPARATOR . 'Stubs';
return __DIR__ . DIRECTORY_SEPARATOR . 'stubs';
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class {{class}} extends Seeder
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
return array(
'path' => '/database/seeds',
'path' => '/database/seeders',
'chunk_size' => 500 // Maximum number of rows per insert statement
);
8 changes: 4 additions & 4 deletions tests/IseedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public function __construct()
{
parent::__construct();

static::$stubsDir = __DIR__.'/../src/Orangehill/Iseed/Stubs';
static::$testStubsDir = __DIR__.'/Stubs';
static::$stubsDir = __DIR__.'/../src/Orangehill/Iseed/stubs';
static::$testStubsDir = __DIR__.'/stubs';
}

public function tearDown(): void
Expand Down Expand Up @@ -2131,7 +2131,7 @@ public function testCanGetStubPath()
{
$iseed = new Orangehill\Iseed\Iseed();
$output = $iseed->getStubPath();
$expected = substr(__DIR__, 0, -5).'src'.DIRECTORY_SEPARATOR.'Orangehill'.DIRECTORY_SEPARATOR.'Iseed'.DIRECTORY_SEPARATOR.'Stubs';
$expected = substr(__DIR__, 0, -5).'src'.DIRECTORY_SEPARATOR.'Orangehill'.DIRECTORY_SEPARATOR.'Iseed'.DIRECTORY_SEPARATOR.'stubs';
$this->assertEquals($expected, $output);
}

Expand All @@ -2142,7 +2142,7 @@ public function testCanGenerateSeed()
$mocked = m::mock(\Orangehill\Iseed\Iseed::class, [$file, $composer])->makePartial();
$mocked->shouldReceive('readStubFile')
->once()
->with(substr(__DIR__, 0, -5).'src'.DIRECTORY_SEPARATOR.'Orangehill'.DIRECTORY_SEPARATOR.'Iseed'.DIRECTORY_SEPARATOR.'Stubs'.DIRECTORY_SEPARATOR.'seed.stub');
->with(substr(__DIR__, 0, -5).'src'.DIRECTORY_SEPARATOR.'Orangehill'.DIRECTORY_SEPARATOR.'Iseed'.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'seed.stub');
$file->shouldReceive('put')->once()->with('seedPath', 'populatedStub');
$mocked->shouldReceive('hasTable')->once()->andReturn(true);
$mocked->shouldReceive('getData')->once()->andReturn([]);
Expand Down
2 changes: 2 additions & 0 deletions tests/Stubs/seed.stub → tests/stubs/seed.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class test_class extends Seeder
Expand Down
2 changes: 2 additions & 0 deletions tests/Stubs/seed_5.stub → tests/stubs/seed_5.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class test_class extends Seeder
Expand Down
2 changes: 2 additions & 0 deletions tests/Stubs/seed_505.stub → tests/stubs/seed_505.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class test_class extends Seeder
Expand Down
2 changes: 2 additions & 0 deletions tests/Stubs/seed_blank.stub → tests/stubs/seed_blank.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class test_class extends Seeder
Expand Down

0 comments on commit a6c54d2

Please sign in to comment.