Apply to tests directory
MODIFY
phpcs.xml
phpcs.xml
<ruleset name="Budget">
<file>./app</file>
<file>./config</file>
+ <file>./tests</file>
<rule ref="PSR12" />
</ruleset>

MODIFY
tests/DuskTestCase.php
tests/DuskTestCase.php
@@ -29,14 +29,16 @@ abstract class DuskTestCase extends BaseTestCase
*/
protected function driver()
{
- $options = (new ChromeOptions)->addArguments([
+ $options = (new ChromeOptions())->addArguments([
'--disable-gpu',
'--headless'
]);
return RemoteWebDriver::create(
- 'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
- ChromeOptions::CAPABILITY, $options
+ 'http://localhost:9515',
+ DesiredCapabilities::chrome()->setCapability(
+ ChromeOptions::CAPABILITY,
+ $options
)
);
}

MODIFY
tests/Feature/EarningTest.php
tests/Feature/EarningTest.php
@@ -9,8 +9,10 @@ use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-class EarningTest extends TestCase {
- public function testUnauthorizedUserCantDeleteEarning() {
+class EarningTest extends TestCase
+{
+ public function testUnauthorizedUserCantDeleteEarning()
+ {
$user = factory(User::class)->create();
$space = factory(Space::class)->create();

MODIFY
tests/Feature/RecurringTest.php
tests/Feature/RecurringTest.php
@@ -9,8 +9,10 @@ use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-class RecurringTest extends TestCase {
- public function testUnauthorizedUserCantViewRecurring() {
+class RecurringTest extends TestCase
+{
+ public function testUnauthorizedUserCantViewRecurring()
+ {
$user = factory(User::class)->create();
$space = factory(Space::class)->create();

MODIFY
tests/Feature/SpendingTest.php
tests/Feature/SpendingTest.php
@@ -9,8 +9,10 @@ use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-class SpendingTest extends TestCase {
- public function testUnauthorizedUserCantDeleteSpending() {
+class SpendingTest extends TestCase
+{
+ public function testUnauthorizedUserCantDeleteSpending()
+ {
$user = factory(User::class)->create();
$space = factory(Space::class)->create();

MODIFY
tests/Feature/TagTest.php
tests/Feature/TagTest.php
@@ -9,9 +9,11 @@ use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-class TagTest extends TestCase {
+class TagTest extends TestCase
+{
// Edit
- public function testAuthorizedUserCanEditTag() {
+ public function testAuthorizedUserCanEditTag()
+ {
$user = factory(User::class)->create();
$space = factory(Space::class)->create();
@@ -29,7 +31,8 @@ class TagTest extends TestCase {
$response->assertStatus(200);
}
- public function testUnauthorizedUserCantEditTag() {
+ public function testUnauthorizedUserCantEditTag()
+ {
$user = factory(User::class)->create();
$space = factory(Space::class)->create();
@@ -46,7 +49,8 @@ class TagTest extends TestCase {
}
// Update
- public function testUpdateTag() {
+ public function testUpdateTag()
+ {
$user = factory(User::class)->create();
$space = factory(Space::class)->create();

MODIFY
tests/Unit/Models/EarningTest.php
tests/Unit/Models/EarningTest.php
@@ -6,11 +6,12 @@ use App\Helper;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-
use App\Models\Earning;
-class EarningTest extends TestCase {
- public function testFormattedAmount() {
+class EarningTest extends TestCase
+{
+ public function testFormattedAmount()
+ {
$earning = factory(Earning::class)->make([
'amount' => Helper::rawNumberToInteger(39)
]);

MODIFY
tests/Unit/Models/SpaceTest.php
tests/Unit/Models/SpaceTest.php
@@ -6,13 +6,14 @@ use App\Helper;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-
use App\Models\Earning;
use App\Models\Spending;
use App\Models\Space;
-class SpaceTest extends TestCase {
- public function testMonthlyBalance() {
+class SpaceTest extends TestCase
+{
+ public function testMonthlyBalance()
+ {
$space = factory(Space::class)->create();
factory(Earning::class)->create([

MODIFY
tests/Unit/Models/SpendingTest.php
tests/Unit/Models/SpendingTest.php
@@ -6,11 +6,12 @@ use App\Helper;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-
use App\Models\Spending;
-class SpendingTest extends TestCase {
- public function testFormattedAmount() {
+class SpendingTest extends TestCase
+{
+ public function testFormattedAmount()
+ {
$spending = factory(Spending::class)->make([
'amount' => Helper::rawNumberToInteger(92.35)
]);

MODIFY
tests/Unit/Models/TagTest.php
tests/Unit/Models/TagTest.php
@@ -10,8 +10,10 @@ use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
-class TagTest extends TestCase {
- public function testMostExpensiveTags() {
+class TagTest extends TestCase
+{
+ public function testMostExpensiveTags()
+ {
$space = factory(Space::class)->create();
$repository = new TagRepository();

Apply PSR-12 to tests directory