refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
42
tests/Unit/Models/EntryTest.php
Normal file
42
tests/Unit/Models/EntryTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Models;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\Models\Journal\Entry;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class EntryTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
/** @test */
|
||||
public function get_info_for_journal_entry()
|
||||
{
|
||||
$entry = factory(Entry::class)->make([
|
||||
'id' => 1,
|
||||
'title' => 'This is the title',
|
||||
'post' => 'this is a post',
|
||||
'created_at' => '2017-01-01 00:00:00',
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'type' => 'entry',
|
||||
'id' => 1,
|
||||
'title' => 'This is the title',
|
||||
'post' => 'this is a post',
|
||||
'day' => 1,
|
||||
'day_name' => 'Sun',
|
||||
'month' => 1,
|
||||
'month_name' => 'JAN',
|
||||
'year' => 2017,
|
||||
'date' => '2017-01-01 00:00:00',
|
||||
'created_at' => 'Jan 01, 2017 00:00',
|
||||
];
|
||||
|
||||
$this->assertEquals(
|
||||
$data,
|
||||
$entry->getInfoForJournalEntry()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user