DawgOnKing
9 months ago

Adding Factory to test POST

Posted 9 months ago by DawgOnKing

How can I refactor the below

$attributes = [
            'sector' => 'CARGO',
            'name' => strToUpper($this->faker->word) . ' AIRWAYS',
            'icao' => 'ABC',
            'iata' => 'AB',
];
        
$response = $this->actingAs($admin)->post('/admin/airline', $attributes)

To the following

$response = $this->actingAs($admin)->post('/admin/airline', factory(Airline::class));

Please sign in or create an account to participate in this conversation.