for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Maestriam\Samurai\Tests\Unit\Entities\Vendor;
use Maestriam\Samurai\Entities\Author;
use Maestriam\Samurai\Foundation\ConfigKeeper;
use Maestriam\Samurai\Tests\TestCase;
/**
* Testes de funcionalidades de definir/receber informações do vendor do tema
*/
class AuthorTestCase extends TestCase
{
* Testa se a classe retorna as propriedades básicas do autor
* com o tipo correto
*
* @return void
public function testAuthorProperties()
$signture = 'Giuliano Sampaio <[email protected]>';
$author = new Author();
$author->set($signture);
$this->assertAuthorProperties($author);
}
* Testa se consegue carregar as informações do autor definido
* no arquivo de configuração do pacote
public function testLoadDefaultAuthor()
$default = $author->default();
$this->assertDefaultAuthor($default);
* Te
private function assertAuthorProperties(Author $author)
$this->assertIsString($author->name());
$this->assertIsString($author->email());
* Undocumented function
* @param Author $author
private function assertDefaultAuthor(Author $author)
$config = new ConfigKeeper();
$default = $config->author();
$this->assertEquals($default->name, $author->name());
$this->assertEquals($default->email, $author->email());