Code style fixes

This commit is contained in:
TakeMeNL
2018-07-20 00:23:17 +02:00
parent c60f1bd50f
commit 39c0829fce
2 changed files with 6 additions and 6 deletions

View File

@@ -19,14 +19,14 @@ class IncidentTemplateController extends AbstractApiController
{
/**
* Get all incident templates.
*
* @return \Illuminate\Http\JsonResponse
*/
public function index()
{
$templates = IncidentTemplate::query();
if ($sortBy = Binput::get('sort'))
{
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$templates->sort($sortBy, $direction);

View File

@@ -15,6 +15,7 @@ use CachetHQ\Cachet\Models\IncidentTemplate;
/**
* This is the incident template test class.
*
* @author Marc Hagen <hello@marchagen.nl>
*/
class IncidentTemplateTest extends AbstractApiTestCase
@@ -25,9 +26,9 @@ class IncidentTemplateTest extends AbstractApiTestCase
$response = $this->json('GET', '/api/v1/incidents/templates');
$response->assertJsonFragment([ 'id' => $templates[0]->id ]);
$response->assertJsonFragment([ 'id' => $templates[1]->id ]);
$response->assertJsonFragment([ 'id' => $templates[2]->id ]);
$response->assertJsonFragment(['id' => $templates[0]->id]);
$response->assertJsonFragment(['id' => $templates[1]->id]);
$response->assertJsonFragment(['id' => $templates[2]->id]);
$response->assertStatus(200);
}
@@ -37,5 +38,4 @@ class IncidentTemplateTest extends AbstractApiTestCase
$response->assertStatus(404);
}
}