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