Browse Source

PSR 2 format on test classes

pull/1/head
Nafies Luthfi 8 years ago
parent
commit
f59f644483
  1. 1
      tests/Feature/Auth/MemberRegistrationTest.php
  2. 2
      tests/Feature/Auth/ResetPasswordTest.php
  3. 1
      tests/Feature/ManageFeaturesTest.php
  4. 2
      tests/Feature/ManageProjectsTest.php
  5. 1
      tests/Feature/ManageTasksTest.php
  6. 3
      tests/Feature/Payments/PaymentSearchTest.php
  7. 2
      tests/TestCase.php
  8. 29
      tests/Unit/Models/ProjectTest.php

1
tests/Feature/Auth/MemberRegistrationTest.php

@ -2,7 +2,6 @@
namespace Tests\Feature\Auth;
use App\Entities\Users\User;
use Tests\TestCase;
class MemberRegistrationTest extends TestCase

2
tests/Feature/Auth/ResetPasswordTest.php

@ -26,7 +26,5 @@ class ResetPasswordTest extends TestCase
$this->seeInDatabase('password_resets', [
'email' => 'testing@app.dev'
]);
}
}

1
tests/Feature/ManageFeaturesTest.php

@ -222,6 +222,5 @@ class ManageFeaturesTest extends TestCase
$this->visit('features');
$this->seePageIs('features');
}
}

2
tests/Feature/ManageProjectsTest.php

@ -6,7 +6,6 @@ use App\Entities\Payments\Payment;
use App\Entities\Projects\Feature;
use App\Entities\Projects\Project;
use App\Entities\Projects\Task;
use App\Entities\Users\Role;
use App\Entities\Users\User;
use Tests\TestCase;
@ -179,5 +178,4 @@ class ManageProjectsTest extends TestCase
'status_id' => 2,
]);
}
}

1
tests/Feature/ManageTasksTest.php

@ -3,7 +3,6 @@
namespace Tests\Feature;
use App\Entities\Projects\Feature;
use App\Entities\Projects\Project;
use App\Entities\Projects\Task;
use App\Entities\Users\User;
use Tests\TestCase;

3
tests/Feature/Payments/PaymentSearchTest.php

@ -4,9 +4,6 @@ namespace Tests\Feature\Payments;
use App\Entities\Payments\Payment;
use App\Entities\Projects\Project;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Tests\TestCase;
class PaymentSearchTest extends TestCase

2
tests/TestCase.php

@ -2,7 +2,6 @@
namespace Tests;
use App\Entities\Users\Role;
use App\Entities\Users\User;
use Tests\Traits\DatabaseMigrateSeeds;
@ -40,7 +39,6 @@ class TestCase extends \Laravel\BrowserKitTesting\TestCase
if (isset($uses[DatabaseMigrateSeeds::class])) {
$this->runDatabaseMigrateSeeds();
}
}
protected function adminUserSigningIn()

29
tests/Unit/Models/ProjectTest.php

@ -4,7 +4,6 @@ namespace Tests\Unit\Models;
use App\Entities\Payments\Payment;
use App\Entities\Projects\Feature;
use App\Entities\Projects\File;
use App\Entities\Projects\Project;
use App\Entities\Projects\Task;
use App\Entities\Subscriptions\Subscription;
@ -19,8 +18,8 @@ class ProjectTest extends TestCase
{
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['project_id' => $project->id]);
$this->assertTrue($project->features instanceOf Collection);
$this->assertTrue($project->features->first() instanceOf Feature);
$this->assertTrue($project->features instanceof Collection);
$this->assertTrue($project->features->first() instanceof Feature);
}
/** @test */
@ -28,8 +27,8 @@ class ProjectTest extends TestCase
{
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['project_id' => $project->id, 'type_id' => 1]);
$this->assertTrue($project->mainFeatures instanceOf Collection);
$this->assertTrue($project->mainFeatures->first() instanceOf Feature);
$this->assertTrue($project->mainFeatures instanceof Collection);
$this->assertTrue($project->mainFeatures->first() instanceof Feature);
}
/** @test */
@ -37,8 +36,8 @@ class ProjectTest extends TestCase
{
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['project_id' => $project->id, 'type_id' => 2]);
$this->assertTrue($project->additionalFeatures instanceOf Collection);
$this->assertTrue($project->additionalFeatures->first() instanceOf Feature);
$this->assertTrue($project->additionalFeatures instanceof Collection);
$this->assertTrue($project->additionalFeatures->first() instanceof Feature);
}
/** @test */
@ -47,8 +46,8 @@ class ProjectTest extends TestCase
$project = factory(Project::class)->create();
$feature = factory(Feature::class)->create(['project_id' => $project->id, 'type_id' => 2]);
$tasks = factory(Task::class, 2)->create(['feature_id' => $feature->id]);
$this->assertTrue($project->tasks instanceOf Collection);
$this->assertTrue($project->tasks->first() instanceOf Task);
$this->assertTrue($project->tasks instanceof Collection);
$this->assertTrue($project->tasks->first() instanceof Task);
}
/** @test */
@ -56,8 +55,8 @@ class ProjectTest extends TestCase
{
$project = factory(Project::class)->create();
$payment = factory(Payment::class)->create(['project_id' => $project->id]);
$this->assertTrue($project->payments instanceOf Collection);
$this->assertTrue($project->payments->first() instanceOf Payment);
$this->assertTrue($project->payments instanceof Collection);
$this->assertTrue($project->payments->first() instanceof Payment);
}
/** @test */
@ -65,15 +64,15 @@ class ProjectTest extends TestCase
{
$project = factory(Project::class)->create();
$subscription = factory(Subscription::class)->create(['project_id' => $project->id]);
$this->assertTrue($project->subscriptions instanceOf Collection);
$this->assertTrue($project->subscriptions->first() instanceOf Subscription);
$this->assertTrue($project->subscriptions instanceof Collection);
$this->assertTrue($project->subscriptions->first() instanceof Subscription);
}
/** @test */
public function it_belongs_to_a_customer()
{
$project = factory(Project::class)->create();
$this->assertTrue($project->customer instanceOf User);
$this->assertTrue($project->customer instanceof User);
}
/** @test */
@ -130,6 +129,6 @@ class ProjectTest extends TestCase
public function it_has_many_files()
{
$project = factory(Project::class)->create();
$this->assertTrue($project->files instanceOf Collection);
$this->assertTrue($project->files instanceof Collection);
}
}
Loading…
Cancel
Save