. */ declare(strict_types=1); namespace Tests\Unit\Transformers; use FireflyIII\Models\Budget; use FireflyIII\Transformers\BudgetTransformer; use Symfony\Component\HttpFoundation\ParameterBag; use Tests\TestCase; /** * Class BudgetTransformerTest */ class BudgetTransformerTest extends TestCase { /** * Basic coverage * * @covers \FireflyIII\Transformers\BudgetTransformer::transform */ public function testBasic() { $budget = Budget::create( [ 'user_id' => $this->user()->id, 'name' => 'Some budget ' . random_int(1, 10000), 'active' => 1, ] ); $transformer = new BudgetTransformer(new ParameterBag); $result = $transformer->transform($budget); $this->assertEquals($budget->name, $result['name']); $this->assertTrue($result['active']); } }