Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Clean up author code #1819

Merged
merged 11 commits into from
Jul 10, 2024
2 changes: 2 additions & 0 deletions packages/framework/src/Facades/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Hyde\Framework\Features\Blogging\Models\PostAuthor;
use Illuminate\Support\Collection;

use function compact;

/**
* Allows you to easily add pre-defined authors for your blog posts.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ class PostAuthor implements Stringable, SerializableContract
*
* If your input is in the form of an array, you may rather want to use the `create` method.
*
* @param string $username
* @param string|null $name
* @param string|null $website
* @param string|null $bio
* @param string|null $avatar
* @param array<string, string> $socials
*/
public function __construct(string $username, ?string $name = null, ?string $website = null, ?string $bio = null, ?string $avatar = null, ?array $socials = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,31 @@

namespace Hyde\Framework\Testing\Unit\Facades;

use Hyde\Hyde;
use Hyde\Facades\Author;
use Hyde\Framework\Features\Blogging\Models\PostAuthor;
use Hyde\Testing\TestCase;
use Hyde\Testing\UnitTestCase;

/**
* @covers \Hyde\Facades\Author
*/
class AuthorTest extends TestCase
class AuthorFacadeTest extends UnitTestCase
{
protected static bool $needsKernel = true;

protected function setUp(): void
{
parent::setUp();

static $config = null;

if ($config === null) {
$config = require Hyde::path('config/hyde.php');
}

self::mockConfig(['hyde' => $config]);
}

public function testCreate()
{
$author = Author::create('John Doe', 'https://johndoe.com');
Expand Down