Adopt Laravel coding style

Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions.

You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started.

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
This commit is contained in:
Laravel Shift
2021-06-10 20:15:52 +00:00
parent 54cb6c050a
commit 934afa036f
4549 changed files with 35238 additions and 38391 deletions
+9 -9
View File
@@ -6,7 +6,7 @@ use App\Models\AssetModel;
use App\Models\Setting;
use Illuminate\Support\Facades\Auth;
class ApiAssetModelsCest
class ApiModelsCest
{
protected $user;
protected $timeFormat;
@@ -21,7 +21,6 @@ class ApiAssetModelsCest
/** @test */
public function indexAssetModels(ApiTester $I)
{
$I->wantTo('Get a list of assetmodels');
// call
@@ -41,7 +40,7 @@ class ApiAssetModelsCest
$I->wantTo('Create a new assetmodel');
$temp_assetmodel = factory(\App\Models\AssetModel::class)->states('mbp-13-model')->make([
'name' => "Test AssetModel Tag",
'name' => 'Test AssetModel Tag',
]);
// setup
@@ -64,6 +63,7 @@ class ApiAssetModelsCest
// Put is routed to the same method in the controller
// DO we actually need to test both?
/** @test */
public function updateAssetModelWithPatch(ApiTester $I, $scenario)
{
@@ -76,7 +76,7 @@ class ApiAssetModelsCest
$I->assertInstanceOf(\App\Models\AssetModel::class, $assetmodel);
$temp_assetmodel = factory(\App\Models\AssetModel::class)->states('polycomcx-model')->make([
'name' => "updated AssetModel name",
'name' => 'updated AssetModel name',
'fieldset_id' => 2,
]);
@@ -95,7 +95,7 @@ class ApiAssetModelsCest
$I->assertNotEquals($assetmodel->name, $data['name']);
// update
$I->sendPATCH('/models/' . $assetmodel->id, $data);
$I->sendPATCH('/models/'.$assetmodel->id, $data);
$I->seeResponseIsJson();
$I->seeResponseCodeIs(200);
@@ -111,7 +111,7 @@ class ApiAssetModelsCest
$temp_assetmodel->updated_at = Carbon::parse($response->payload->updated_at);
$temp_assetmodel->id = $assetmodel->id;
// verify
$I->sendGET('/models/' . $assetmodel->id);
$I->sendGET('/models/'.$assetmodel->id);
$I->seeResponseIsJson();
$I->seeResponseCodeIs(200);
$I->seeResponseContainsJson((new AssetModelsTransformer)->transformAssetModel($temp_assetmodel));
@@ -124,12 +124,12 @@ class ApiAssetModelsCest
// create
$assetmodel = factory(\App\Models\AssetModel::class)->states('mbp-13-model')->create([
'name' => "Soon to be deleted"
'name' => 'Soon to be deleted',
]);
$I->assertInstanceOf(\App\Models\AssetModel::class, $assetmodel);
// delete
$I->sendDELETE('/models/' . $assetmodel->id);
$I->sendDELETE('/models/'.$assetmodel->id);
$I->seeResponseIsJson();
$I->seeResponseCodeIs(200);
@@ -138,7 +138,7 @@ class ApiAssetModelsCest
$I->assertEquals(trans('admin/models/message.delete.success'), $response->messages);
// verify, expect a 200
$I->sendGET('/models/' . $assetmodel->id);
$I->sendGET('/models/'.$assetmodel->id);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
}