. */ declare(strict_types=1); namespace Tests\Unit\Transformers; use FireflyIII\Models\TransactionJournalMeta; use FireflyIII\Transformers\JournalMetaTransformer; use Symfony\Component\HttpFoundation\ParameterBag; use Tests\TestCase; /** * Class JournalMetaTransformerTest */ class JournalMetaTransformerTest extends TestCase { /** * Basic coverage * * @covers \FireflyIII\Transformers\JournalMetaTransformer::transform */ public function testBasic() { $data = 'Lots of data'; $hash = hash('sha256', json_encode($data)); $meta = TransactionJournalMeta::create( [ 'transaction_journal_id' => 1, 'name' => 'someField', 'data' => $data, ] ); $transformer = new JournalMetaTransformer(new ParameterBag); $result = $transformer->transform($meta); $this->assertEquals($meta->name, $result['name']); $this->assertEquals($hash, $result['hash']); } }