This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expanded and improved encoding unit/integration tests
- Loading branch information
Coen Zimmerman
committed
Apr 15, 2017
1 parent
14b53fc
commit 4b4c16d
Showing
21 changed files
with
1,041 additions
and
157 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
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
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,23 @@ | ||
<?php | ||
namespace Czim\JsonApi\Test\Helpers\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class TestAuthor extends Model | ||
{ | ||
protected $fillable = [ | ||
'name', | ||
'image', | ||
]; | ||
|
||
public function posts() | ||
{ | ||
return $this->hasMany(TestPost::class); | ||
} | ||
|
||
public function comments() | ||
{ | ||
return $this->hasMany(TestComment::class); | ||
} | ||
|
||
} |
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,29 @@ | ||
<?php | ||
namespace Czim\JsonApi\Test\Helpers\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class TestComment extends Model | ||
{ | ||
protected $fillable = [ | ||
'title', | ||
'body', | ||
'description', | ||
]; | ||
|
||
public function author() | ||
{ | ||
return $this->belongsTo(TestAuthor::class, 'test_author_id'); | ||
} | ||
|
||
public function post() | ||
{ | ||
return $this->belongsTo(TestPost::class, 'test_post_id'); | ||
} | ||
|
||
public function seos() | ||
{ | ||
return $this->morphMany(TestSeo::class, 'seoable'); | ||
} | ||
|
||
} |
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,55 @@ | ||
<?php | ||
namespace Czim\JsonApi\Test\Helpers\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* Class TestPost | ||
* | ||
* @property string $title | ||
* @property string $body | ||
* @property string $type | ||
* @property bool $checked | ||
* @property string $description | ||
*/ | ||
class TestPost extends Model | ||
{ | ||
protected $fillable = [ | ||
'title', | ||
'body', | ||
'type', | ||
'checked', | ||
'description', | ||
]; | ||
|
||
protected $casts = [ | ||
'checked' => 'boolean', | ||
]; | ||
|
||
public $test = false; | ||
|
||
|
||
public function author() | ||
{ | ||
return $this->belongsTo(TestAuthor::class, 'test_author_id'); | ||
} | ||
|
||
public function comments() | ||
{ | ||
return $this->hasMany(TestComment::class); | ||
} | ||
|
||
public function seo() | ||
{ | ||
return $this->morphOne(TestSeo::class, 'seoable'); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function testMethod() | ||
{ | ||
return 'testing method value'; | ||
} | ||
|
||
} |
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,12 @@ | ||
<?php | ||
namespace Czim\JsonApi\Test\Helpers\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class TestPostTranslation extends Model | ||
{ | ||
protected $fillable = [ | ||
'body', | ||
]; | ||
|
||
} |
Oops, something went wrong.