Files
monica/tests/Unit/EntryTest.php
T
Régis FreydandGitHub b65a7b7a73 Remove encryption in the journal table (#199)
I used to encrypt this but the decryption randomly generates problems sometimes. I wonder why. Is it because of special characters that are included and get corrupted while encrypted? I don't know, but I've found that removing the encryption (which is not necessary anyway), solves the problem - until we find a better solution.
2017-06-10 23:10:19 -04:00

51 lines
1.0 KiB
PHP

<?php
namespace Tests\Unit;
use App\Entry;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
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()
);
}
}