Skip to content

Commit

Permalink
Merge pull request #1819 from hydephp/clean-up-author-code
Browse files Browse the repository at this point in the history
[2.x] Clean up author code
  • Loading branch information
caendesilva authored Jul 10, 2024
2 parents 909b8ee + 483e4e9 commit 868f742
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
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

0 comments on commit 868f742

Please sign in to comment.