Skip to content

Commit

Permalink
Merge pull request #27 from djoudi/master
Browse files Browse the repository at this point in the history
Add Laravel 6.0 Support
  • Loading branch information
weotch authored Sep 21, 2019
2 parents 0f16b54 + 58c41db commit 4a07655
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 22 deletions.
Binary file added .phpintel/0801aefb29f7a71858a2a21c12889638
Binary file not shown.
Binary file added .phpintel/9a61876eeb183760807a2dc585ba338f
Binary file not shown.
Binary file added .phpintel/dc5064f39c91477a8d52fa1b186d34c0
Binary file not shown.
Binary file added .phpintel/f0e44c065f1f78f17cd4120a17252801
Binary file not shown.
Binary file added .phpintel/index
Binary file not shown.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
}
],
"require": {
"php": ">=5.5.0",
"illuminate/support": "4 - 5"
"php": ">=7.0",
"illuminate/support": "^5.5|^6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.7",
"bkwld/upchuck": "^2.0@dev",
"illuminate/database": "4 - 5",
"phpunit/phpunit": "~6.0|~8.0",
"bkwld/upchuck": "^2.6@dev",
"illuminate/database": "^5.5|^6.0",
"league/flysystem-vfs": "^1.0",
"mockery/mockery": "^0.9.4",
"mockery/mockery": "^1.2.3",
"satooshi/php-coveralls": "^1.0"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion src/Cloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Deps
use Illuminate\Events\Dispatcher as Events;
use Illuminate\Support\Arr;

/**
* Core class that traverses a model's relationships and replicates model
Expand Down Expand Up @@ -168,7 +169,7 @@ protected function duplicatePivotedRelation($relation, $relation_name, $clone) {

// Loop trough current relations and attach to clone
$relation->get()->each(function ($foreign) use ($clone, $relation_name) {
$pivot_attributes = array_except($foreign->pivot->getAttributes(), [
$pivot_attributes = Arr::except($foreign->pivot->getAttributes(), [
$foreign->pivot->getRelatedKey(),
$foreign->pivot->getForeignKey(),
$foreign->pivot->getCreatedAtColumn(),
Expand Down
3 changes: 2 additions & 1 deletion tests/CloneableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// Deps
use Bkwld\Cloner\Stubs\Article;
use Mockery as m;
use PHPUnit\Framework\TestCase;

/**
* Test the trait
*/
class CloneableTest extends PHPUnit_Framework_TestCase {
class CloneableTest extends TestCase {

public function testDuplicate() {

Expand Down
25 changes: 13 additions & 12 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
use League\Flysystem\MountManager;
use Mockery as m;
use VirtualFileSystem\FileSystem as Vfs;
use PHPUnit\Framework\TestCase;

class FunctionalTest extends PHPUnit_Framework_TestCase
class FunctionalTest extends TestCase
{

private $article;
Expand Down Expand Up @@ -81,42 +82,42 @@ protected function setUpDatabase()
protected function migrateTables($connection = 'default')
{
DB::connection($connection)->getSchemaBuilder()->create('articles', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('title');
$table->timestamps();
});

DB::connection($connection)->getSchemaBuilder()->create('authors', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name');
$table->timestamps();
});

DB::connection($connection)->getSchemaBuilder()->create('article_author', function (Blueprint $table) {
$table->increments('id');
$table->integer('article_id')->unsigned();
$table->integer('author_id')->unsigned();
$table->bigIncrements('id');
$table->bigInteger('article_id')->unsigned();
$table->bigInteger('author_id')->unsigned();
});

DB::connection($connection)->getSchemaBuilder()->create('photos', function (Blueprint $table) {
$table->increments('id');
$table->integer('article_id')->unsigned();
$table->bigIncrements('id');
$table->bigInteger('article_id')->unsigned();
$table->string('uid');
$table->string('image');
$table->boolean('source')->nullable();
$table->timestamps();
});

DB::connection($connection)->getSchemaBuilder()->create('users', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name');
$table->timestamps();
});

DB::connection($connection)->getSchemaBuilder()->create('article_user', function (Blueprint $table) {
$table->integer('rating')->unsigned();
$table->integer('user_id')->unsigned();
$table->integer('article_id')->unsigned();
$table->bigInteger('rating')->unsigned();
$table->bigInteger('user_id')->unsigned();
$table->bigInteger('article_id')->unsigned();
$table->timestamps();
});
}
Expand Down
4 changes: 3 additions & 1 deletion tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// Deps
use Bkwld\Cloner\ServiceProvider;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class ServiceProviderTest extends PHPUnit_Framework_TestCase {

class ServiceProviderTest extends TestCase {

function testProvides() {
$app = m::mock('Illuminate\Foundation\Application');
Expand Down

0 comments on commit 4a07655

Please sign in to comment.