Files
monica/tests/Unit/EntryTest.php
T
Régis Freyd a2172f0851 Add style CI (#503)
Hopefully this will result in slightly better code.
2017-07-26 21:02:55 -04:00

49 lines
939 B
PHP

<?php
namespace Tests\Unit;
use App\Entry;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class EntryTest extends TestCase
{
use DatabaseTransactions;
public function testGetPostReturnsNullIfUndefined()
{
$entry = new Entry;
$this->assertNull($entry->getPost());
}
public function testGetPostReturnsPost()
{
$entry = new Entry;
$entry->post = 'This is a test';
$this->assertEquals(
'This is a test',
$entry->getPost()
);
}
public function testGetTitleReturnsNullIfUndefined()
{
$entry = new Entry;
$this->assertNull($entry->getTitle());
}
public function testGetTitleReturnsTitle()
{
$entry = new Entry;
$entry->title = 'This is a test';
$this->assertEquals(
'This is a test',
$entry->getTitle()
);
}
}