public function toArrayMethodShouldTransformData()
{
// Arrange...
$responseBuilder = $this->app->make('responder.success');
$model = $this->makeModel(['foo' => 123]);
$responseBuilder->transform($model, function ($model) {
return ['foo' => (string) $model->foo];
});
// Act...
$array = $responseBuilder->toArray();
// Assert...
$this->assertContains(['foo' => '123'], $array);
}