-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e039062
commit 64616a6
Showing
2 changed files
with
33 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\Unit; | ||
|
||
use Hyde\Framework\Models\Author; | ||
use Tests\TestCase; | ||
|
||
/** | ||
* Class HasAuthorTest. | ||
* | ||
* @covers \Hyde\Framework\Models\Author::getName | ||
*/ | ||
class AuthorGetNameTest extends TestCase | ||
{ | ||
// Test get name helper returns name if set | ||
public function test_get_name_helper_returns_name_if_set() | ||
{ | ||
$author = new Author('username'); | ||
$author->name = 'John Doe'; | ||
|
||
$this->assertEquals('John Doe', $author->getName()); | ||
} | ||
|
||
// Test get name helper returns username if name is not set | ||
public function test_get_name_helper_returns_username_if_name_is_not_set() | ||
{ | ||
$author = new Author('username'); | ||
|
||
$this->assertEquals('username', $author->getName()); | ||
} | ||
} |