-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: converted
MarkdownWithDateModel
abstract class to a trait `Wi…
…thDate` + tests refactoring - Implement `WithDate` trait - Remove `MarkdownWithDateModel` abstract class - Moved tests fixtures to a dedicated folder - Create a `Fixture` support class to get fixtures' filesystem for tests - Moved fake classes (`TestModel` and `TestWithDateModel`) outside tests files - Update README.md
- Loading branch information
1 parent
43c9227
commit d3dade5
Showing
14 changed files
with
87 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace TheBatClaudio\EloquentMarkdown\Tests\Support; | ||
|
||
use Illuminate\Contracts\Filesystem\Filesystem; | ||
use Illuminate\Support\Facades\Storage; | ||
|
||
class Fixture | ||
{ | ||
protected static ?Filesystem $filesystem = null; | ||
|
||
public static function getFilesystem(): Filesystem | ||
{ | ||
if (! static::$filesystem) { | ||
static::$filesystem = Storage::build([ | ||
'driver' => 'local', | ||
'root' => './tests/fixtures/content/', | ||
]); | ||
} | ||
|
||
return static::$filesystem; | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace TheBatClaudio\EloquentMarkdown\Tests\Support\Models; | ||
|
||
use TheBatClaudio\EloquentMarkdown\Models\MarkdownModel; | ||
|
||
class TestModel extends MarkdownModel | ||
{ | ||
protected static function getContentPath(): string | ||
{ | ||
return 'pages'; | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace TheBatClaudio\EloquentMarkdown\Tests\Support\Models; | ||
|
||
use TheBatClaudio\EloquentMarkdown\Models\MarkdownModel; | ||
use TheBatClaudio\EloquentMarkdown\Models\Traits\WithDate; | ||
|
||
class TestWithDateModel extends MarkdownModel | ||
{ | ||
use WithDate; | ||
|
||
protected static function getContentPath(): string | ||
{ | ||
return 'blog'; | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.