Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlap authored and StyleCIBot committed Jul 3, 2017
1 parent 7625ac5 commit a722b65
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
22 changes: 12 additions & 10 deletions tests/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
use Victorlap\Approvable\Tests\Models\UserCanApprove;
use Victorlap\Approvable\Tests\Models\UserCannotApprove;


class BaseTests extends TestCase
class BaseTest extends TestCase
{

private function returnUserInstance($model = User::class)
{
$instance = new $model([
Expand All @@ -21,39 +19,43 @@ private function returnUserInstance($model = User::class)
return $instance;
}

public function testApproverCanCreate() {
public function testApproverCanCreate()
{
$user = $this->returnUserInstance(UserCanApprove::class);

$user->save();

$this->assertTrue($user->exists);
}

public function testRegularCanCreate() {
public function testRegularCanCreate()
{
$user = $this->returnUserInstance(UserCannotApprove::class);

$user->save();

$this->assertTrue($user->exists);
}

public function testApproverCanEdit() {
public function testApproverCanEdit()
{
$user = $this->returnUserInstance(UserCanApprove::class);
$user->save();

$user->name = 'Doe John';
$user->save();

$this->assertEquals('Doe John', $user->fresh()->name);
$this->assertEquals('Doe John', $user->fresh()->name);
}

public function testRegularCannotEdit() {
public function testRegularCannotEdit()
{
$user = $this->returnUserInstance(UserCannotApprove::class);
$user->save();

$user->name = 'Doe John';
$user->save();

$this->assertEquals('John Doe', $user->fresh()->name);
$this->assertEquals('John Doe', $user->fresh()->name);
}
}
}
3 changes: 1 addition & 2 deletions tests/Models/UserCanApprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace Victorlap\Approvable\Tests\Models;


class UserCanApprove extends User
{
protected function currentUserCanApprove()
{
return true;
}
}
}
3 changes: 1 addition & 2 deletions tests/Models/UserCannotApprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace Victorlap\Approvable\Tests\Models;


class UserCannotApprove extends User
{
protected function currentUserCanApprove()
{
return false;
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ protected function getPackageProviders($app)
ConsoleServiceProvider::class,
];
}
}
}

0 comments on commit a722b65

Please sign in to comment.