Skip to content

Commit

Permalink
Fixes tests.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Apr 17, 2017
1 parent 1f84846 commit 251b896
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion tests/EloquentTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php namespace Orchestra\Model\TestCase;

use Orchestra\Model\Eloquent;
use PHPUnit\Framework\TestCase;

class EloquentTest extends \PHPUnit_Framework_TestCase
class EloquentTest extends TestCase
{
public function testIsSoftDeletingMethod()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Memory/UserMetaProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php namespace Orchestra\Model\TestCase;

use Mockery as m;
use PHPUnit\Framework\TestCase;
use Illuminate\Container\Container;
use Orchestra\Model\Memory\UserMetaProvider;

class UserMetaProviderTest extends \PHPUnit_Framework_TestCase
class UserMetaProviderTest extends TestCase
{
/**
* Application instance.
Expand Down
3 changes: 2 additions & 1 deletion tests/Memory/UserMetaRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

use Mockery as m;
use Illuminate\Support\Fluent;
use PHPUnit\Framework\TestCase;
use Illuminate\Container\Container;
use Orchestra\Model\Memory\UserMetaRepository;

class UserMetaRepositoryTest extends \PHPUnit_Framework_TestCase
class UserMetaRepositoryTest extends TestCase
{
/**
* Application instance.
Expand Down
3 changes: 2 additions & 1 deletion tests/Observer/RoleTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php namespace Orchestra\Model\Observer\TestCase;

use Mockery as m;
use PHPUnit\Framework\TestCase;
use Orchestra\Model\Observer\Role as RoleObserver;

class RoleTest extends \PHPUnit_Framework_TestCase
class RoleTest extends TestCase
{
/**
* Teardown the test environment.
Expand Down
11 changes: 8 additions & 3 deletions tests/RoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use Mockery as m;
use Orchestra\Model\Role;
use PHPUnit\Framework\TestCase;
use Orchestra\Support\Traits\Testing\MockEloquentConnection;

class RoleTest extends \PHPUnit_Framework_TestCase
class RoleTest extends TestCase
{
use MockEloquentConnection;

Expand Down Expand Up @@ -62,7 +63,9 @@ public function testAdminMethod()
->andReturn($processor = m::mock('Illuminate\Database\Query\Processors\Processor'));

$grammar->shouldReceive('compileSelect')->once()->andReturn('SELECT * FROM `roles` WHERE id=?');
$connection->shouldReceive('select')->once()->with('SELECT * FROM `roles` WHERE id=?', [10], true)->andReturn(null);
$connection->shouldReceive('getName')->once()->andReturn('mysql')
->shouldReceive('select')->once()
->with('SELECT * FROM `roles` WHERE id=?', [10], true)->andReturn(null);
$processor->shouldReceive('processSelect')->once()->andReturn([]);

$model->admin();
Expand All @@ -89,7 +92,9 @@ public function testMemberMethod()
->andReturn($processor = m::mock('Illuminate\Database\Query\Processors\Processor'));

$grammar->shouldReceive('compileSelect')->once()->andReturn('SELECT * FROM `roles` WHERE id=?');
$connection->shouldReceive('select')->once()->with('SELECT * FROM `roles` WHERE id=?', [20], true)->andReturn(null);
$connection->shouldReceive('getName')->once()->andReturn('mysql')
->shouldReceive('select')->once()
->with('SELECT * FROM `roles` WHERE id=?', [20], true)->andReturn(null);
$processor->shouldReceive('processSelect')->once()->andReturn([]);

$model->member();
Expand Down
3 changes: 2 additions & 1 deletion tests/UserMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use Mockery as m;
use Orchestra\Model\UserMeta;
use PHPUnit\Framework\TestCase;
use Orchestra\Support\Traits\Testing\MockEloquentConnection;

class UserMetaTest extends \PHPUnit_Framework_TestCase
class UserMetaTest extends TestCase
{
use MockEloquentConnection;

Expand Down
3 changes: 2 additions & 1 deletion tests/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

use Mockery as m;
use Orchestra\Model\User;
use PHPUnit\Framework\TestCase;
use Illuminate\Container\Container;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Facade;
use Orchestra\Support\Traits\Testing\MockEloquentConnection;

class UserTest extends \PHPUnit_Framework_TestCase
class UserTest extends TestCase
{
use MockEloquentConnection;

Expand Down

0 comments on commit 251b896

Please sign in to comment.