Commit bdb15c94 authored by Stas's avatar Stas Committed by Jens Segers

Fix tests (#1724)

*   Update Dockerfile, add for methods setUp and tearDown return type hint in all tests, replace fire on dispatch

* Resolve error test with touch

* Use COMPOSER_VERSION in Dockerfile

* Add alias for composer

* Change parent method's names
Broken commit in laravel: https://github.com/laravel/framework/commit/2ee18923eaff142a89439f0adf0d3f15c30db85b

* Remove changes in .travis.yml

* Remove changes from Dockerfile

* Revert changes in docker-compose.yml

* Update image with mysql
parent 55c1aa15
...@@ -16,7 +16,7 @@ services: ...@@ -16,7 +16,7 @@ services:
mysql: mysql:
container_name: mysql container_name: mysql
image: mysql image: mysql:5.7
environment: environment:
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD:
MYSQL_DATABASE: unittest MYSQL_DATABASE: unittest
......
...@@ -177,6 +177,31 @@ class Builder extends EloquentBuilder ...@@ -177,6 +177,31 @@ class Builder extends EloquentBuilder
return $results; return $results;
} }
/**
* Add the "updated at" column to an array of values.
* TODO Remove if https://github.com/laravel/framework/commit/6484744326531829341e1ff886cc9b628b20d73e
* wiil be reverted
* Issue in laravel frawework https://github.com/laravel/framework/issues/27791
*
* @param array $values
* @return array
*/
protected function addUpdatedAtColumn(array $values)
{
if (! $this->model->usesTimestamps() ||
is_null($this->model->getUpdatedAtColumn())) {
return $values;
}
$column = $this->model->getUpdatedAtColumn();
$values = array_merge(
[$column => $this->model->freshTimestampString()],
$values
);
return $values;
}
/** /**
* @return \Illuminate\Database\ConnectionInterface * @return \Illuminate\Database\ConnectionInterface
*/ */
......
...@@ -110,7 +110,7 @@ trait QueriesRelationships ...@@ -110,7 +110,7 @@ trait QueriesRelationships
} }
if ($relation instanceof BelongsTo) { if ($relation instanceof BelongsTo) {
return $relation->getForeignKey(); return $relation->getForeignKeyName();
} }
if ($relation instanceof BelongsToMany && ! $this->isAcrossConnections($relation)) { if ($relation instanceof BelongsToMany && ! $this->isAcrossConnections($relation)) {
...@@ -130,7 +130,7 @@ trait QueriesRelationships ...@@ -130,7 +130,7 @@ trait QueriesRelationships
return $relation->getHasCompareKey(); return $relation->getHasCompareKey();
} }
return $relation instanceof HasOneOrMany ? $relation->getForeignKeyName() : $relation->getOwnerKey(); return $relation instanceof HasOneOrMany ? $relation->getForeignKeyName() : $relation->getOwnerKeyName();
} }
/** /**
......
...@@ -5,8 +5,9 @@ use Illuminate\Foundation\Application; ...@@ -5,8 +5,9 @@ use Illuminate\Foundation\Application;
class AuthTest extends TestCase class AuthTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
parent::setUp();
User::truncate(); User::truncate();
DB::collection('password_reminders')->truncate(); DB::collection('password_reminders')->truncate();
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class EmbeddedRelationsTest extends TestCase class EmbeddedRelationsTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
Mockery::close(); Mockery::close();
...@@ -21,11 +21,11 @@ class EmbeddedRelationsTest extends TestCase ...@@ -21,11 +21,11 @@ class EmbeddedRelationsTest extends TestCase
$address = new Address(['city' => 'London']); $address = new Address(['city' => 'London']);
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($address), $address)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($address), $address)->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.created: ' . get_class($address), $address); $events->shouldReceive('dispatch')->once()->with('eloquent.created: ' . get_class($address), $address);
$events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($address), $address); $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($address), $address);
$address = $user->addresses()->save($address); $address = $user->addresses()->save($address);
$address->unsetEventDispatcher(); $address->unsetEventDispatcher();
...@@ -47,11 +47,11 @@ class EmbeddedRelationsTest extends TestCase ...@@ -47,11 +47,11 @@ class EmbeddedRelationsTest extends TestCase
$this->assertEquals(['London', 'Paris'], $user->addresses->pluck('city')->all()); $this->assertEquals(['London', 'Paris'], $user->addresses->pluck('city')->all());
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($address), $address)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($address), $address)->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.updated: ' . get_class($address), $address); $events->shouldReceive('dispatch')->once()->with('eloquent.updated: ' . get_class($address), $address);
$events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($address), $address); $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($address), $address);
$address->city = 'New York'; $address->city = 'New York';
$user->addresses()->save($address); $user->addresses()->save($address);
...@@ -94,16 +94,16 @@ class EmbeddedRelationsTest extends TestCase ...@@ -94,16 +94,16 @@ class EmbeddedRelationsTest extends TestCase
// $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); // $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
// $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true); // $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true);
// $events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($address), $address)->andReturn(true); // $events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($address), $address)->andReturn(true);
// $events->shouldReceive('fire')->once()->with('eloquent.created: ' . get_class($address), $address); // $events->shouldReceive('dispatch')->once()->with('eloquent.created: ' . get_class($address), $address);
// $events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($address), $address); // $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($address), $address);
// $address->save(); // $address->save();
// $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); // $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
// $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true); // $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true);
// $events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($address), $address)->andReturn(true); // $events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($address), $address)->andReturn(true);
// $events->shouldReceive('fire')->once()->with('eloquent.updated: ' . get_class($address), $address); // $events->shouldReceive('dispatch')->once()->with('eloquent.updated: ' . get_class($address), $address);
// $events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($address), $address); // $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($address), $address);
// $address->city = 'Paris'; // $address->city = 'Paris';
// $address->save(); // $address->save();
...@@ -213,9 +213,9 @@ class EmbeddedRelationsTest extends TestCase ...@@ -213,9 +213,9 @@ class EmbeddedRelationsTest extends TestCase
$address = $user->addresses->first(); $address = $user->addresses->first();
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.deleting: ' . get_class($address), Mockery::type('Address'))->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.deleting: ' . get_class($address), Mockery::type('Address'))->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.deleted: ' . get_class($address), Mockery::type('Address')); $events->shouldReceive('dispatch')->once()->with('eloquent.deleted: ' . get_class($address), Mockery::type('Address'));
$user->addresses()->destroy($address->_id); $user->addresses()->destroy($address->_id);
$this->assertEquals(['Bristol', 'Bruxelles'], $user->addresses->pluck('city')->all()); $this->assertEquals(['Bristol', 'Bruxelles'], $user->addresses->pluck('city')->all());
...@@ -252,9 +252,9 @@ class EmbeddedRelationsTest extends TestCase ...@@ -252,9 +252,9 @@ class EmbeddedRelationsTest extends TestCase
$address = $user->addresses->first(); $address = $user->addresses->first();
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.deleting: ' . get_class($address), Mockery::type('Address'))->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.deleting: ' . get_class($address), Mockery::type('Address'))->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.deleted: ' . get_class($address), Mockery::type('Address')); $events->shouldReceive('dispatch')->once()->with('eloquent.deleted: ' . get_class($address), Mockery::type('Address'));
$address->delete(); $address->delete();
...@@ -301,7 +301,7 @@ class EmbeddedRelationsTest extends TestCase ...@@ -301,7 +301,7 @@ class EmbeddedRelationsTest extends TestCase
$address = new Address(['city' => 'London']); $address = new Address(['city' => 'London']);
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($address), $address)->andReturn(false); $events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($address), $address)->andReturn(false);
...@@ -316,7 +316,7 @@ class EmbeddedRelationsTest extends TestCase ...@@ -316,7 +316,7 @@ class EmbeddedRelationsTest extends TestCase
$address->exists = true; $address->exists = true;
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(false); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(false);
$this->assertFalse($user->addresses()->save($address)); $this->assertFalse($user->addresses()->save($address));
...@@ -330,7 +330,7 @@ class EmbeddedRelationsTest extends TestCase ...@@ -330,7 +330,7 @@ class EmbeddedRelationsTest extends TestCase
$user->addresses()->save($address); $user->addresses()->save($address);
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($address), $address)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($address), $address)->andReturn(false); $events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($address), $address)->andReturn(false);
...@@ -348,7 +348,7 @@ class EmbeddedRelationsTest extends TestCase ...@@ -348,7 +348,7 @@ class EmbeddedRelationsTest extends TestCase
$address = $user->addresses->first(); $address = $user->addresses->first();
$address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $address->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($address), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($address), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.deleting: ' . get_class($address), Mockery::mustBe($address))->andReturn(false); $events->shouldReceive('until')->once()->with('eloquent.deleting: ' . get_class($address), Mockery::mustBe($address))->andReturn(false);
$this->assertEquals(0, $user->addresses()->destroy($address)); $this->assertEquals(0, $user->addresses()->destroy($address));
...@@ -452,11 +452,11 @@ class EmbeddedRelationsTest extends TestCase ...@@ -452,11 +452,11 @@ class EmbeddedRelationsTest extends TestCase
$father = new User(['name' => 'Mark Doe']); $father = new User(['name' => 'Mark Doe']);
$father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($father), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($father), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($father), $father)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($father), $father)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($father), $father)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($father), $father)->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.created: ' . get_class($father), $father); $events->shouldReceive('dispatch')->once()->with('eloquent.created: ' . get_class($father), $father);
$events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($father), $father); $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($father), $father);
$father = $user->father()->save($father); $father = $user->father()->save($father);
$father->unsetEventDispatcher(); $father->unsetEventDispatcher();
...@@ -472,11 +472,11 @@ class EmbeddedRelationsTest extends TestCase ...@@ -472,11 +472,11 @@ class EmbeddedRelationsTest extends TestCase
$this->assertInstanceOf('MongoDB\BSON\ObjectID', $raw['_id']); $this->assertInstanceOf('MongoDB\BSON\ObjectID', $raw['_id']);
$father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($father), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($father), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($father), $father)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($father), $father)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($father), $father)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.updating: ' . get_class($father), $father)->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.updated: ' . get_class($father), $father); $events->shouldReceive('dispatch')->once()->with('eloquent.updated: ' . get_class($father), $father);
$events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($father), $father); $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($father), $father);
$father->name = 'Tom Doe'; $father->name = 'Tom Doe';
$user->father()->save($father); $user->father()->save($father);
...@@ -488,11 +488,11 @@ class EmbeddedRelationsTest extends TestCase ...@@ -488,11 +488,11 @@ class EmbeddedRelationsTest extends TestCase
$father = new User(['name' => 'Jim Doe']); $father = new User(['name' => 'Jim Doe']);
$father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($father), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($father), Mockery::any());
$events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($father), $father)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.saving: ' . get_class($father), $father)->andReturn(true);
$events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($father), $father)->andReturn(true); $events->shouldReceive('until')->once()->with('eloquent.creating: ' . get_class($father), $father)->andReturn(true);
$events->shouldReceive('fire')->once()->with('eloquent.created: ' . get_class($father), $father); $events->shouldReceive('dispatch')->once()->with('eloquent.created: ' . get_class($father), $father);
$events->shouldReceive('fire')->once()->with('eloquent.saved: ' . get_class($father), $father); $events->shouldReceive('dispatch')->once()->with('eloquent.saved: ' . get_class($father), $father);
$father = $user->father()->save($father); $father = $user->father()->save($father);
$father->unsetEventDispatcher(); $father->unsetEventDispatcher();
...@@ -507,7 +507,7 @@ class EmbeddedRelationsTest extends TestCase ...@@ -507,7 +507,7 @@ class EmbeddedRelationsTest extends TestCase
$father = new User(['name' => 'Mark Doe']); $father = new User(['name' => 'Mark Doe']);
$father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher')); $father->setEventDispatcher($events = Mockery::mock('Illuminate\Events\Dispatcher'));
$events->shouldReceive('fire')->with('eloquent.retrieved: ' . get_class($father), Mockery::any()); $events->shouldReceive('dispatch')->with('eloquent.retrieved: ' . get_class($father), Mockery::any());
$events->shouldReceive('until')->times(0)->with('eloquent.saving: ' . get_class($father), $father); $events->shouldReceive('until')->times(0)->with('eloquent.saving: ' . get_class($father), $father);
$father = $user->father()->associate($father); $father = $user->father()->associate($father);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class GeospatialTest extends TestCase class GeospatialTest extends TestCase
{ {
public function setUp() public function setUp(): void
{ {
parent::setUp(); parent::setUp();
...@@ -43,7 +43,7 @@ class GeospatialTest extends TestCase ...@@ -43,7 +43,7 @@ class GeospatialTest extends TestCase
]); ]);
} }
public function tearDown() public function tearDown(): void
{ {
Schema::drop('locations'); Schema::drop('locations');
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class HybridRelationsTest extends TestCase class HybridRelationsTest extends TestCase
{ {
public function setUp() public function setUp(): void
{ {
parent::setUp(); parent::setUp();
...@@ -11,7 +11,7 @@ class HybridRelationsTest extends TestCase ...@@ -11,7 +11,7 @@ class HybridRelationsTest extends TestCase
MysqlRole::executeSchema(); MysqlRole::executeSchema();
} }
public function tearDown() public function tearDown(): void
{ {
MysqlUser::truncate(); MysqlUser::truncate();
MysqlBook::truncate(); MysqlBook::truncate();
......
...@@ -8,7 +8,7 @@ use MongoDB\BSON\UTCDateTime; ...@@ -8,7 +8,7 @@ use MongoDB\BSON\UTCDateTime;
class ModelTest extends TestCase class ModelTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
User::truncate(); User::truncate();
Soft::truncate(); Soft::truncate();
...@@ -262,7 +262,6 @@ class ModelTest extends TestCase ...@@ -262,7 +262,6 @@ class ModelTest extends TestCase
$user->save(); $user->save();
$old = $user->updated_at; $old = $user->updated_at;
sleep(1); sleep(1);
$user->touch(); $user->touch();
$check = User::find($user->_id); $check = User::find($user->_id);
......
...@@ -5,7 +5,7 @@ use MongoDB\BSON\Regex; ...@@ -5,7 +5,7 @@ use MongoDB\BSON\Regex;
class QueryBuilderTest extends TestCase class QueryBuilderTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
DB::collection('users')->truncate(); DB::collection('users')->truncate();
DB::collection('items')->truncate(); DB::collection('items')->truncate();
......
...@@ -4,7 +4,7 @@ class QueryTest extends TestCase ...@@ -4,7 +4,7 @@ class QueryTest extends TestCase
{ {
protected static $started = false; protected static $started = false;
public function setUp() public function setUp(): void
{ {
parent::setUp(); parent::setUp();
User::create(['name' => 'John Doe', 'age' => 35, 'title' => 'admin']); User::create(['name' => 'John Doe', 'age' => 35, 'title' => 'admin']);
...@@ -18,7 +18,7 @@ class QueryTest extends TestCase ...@@ -18,7 +18,7 @@ class QueryTest extends TestCase
User::create(['name' => 'Error', 'age' => null, 'title' => null]); User::create(['name' => 'Error', 'age' => null, 'title' => null]);
} }
public function tearDown() public function tearDown(): void
{ {
User::truncate(); User::truncate();
parent::tearDown(); parent::tearDown();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class QueueTest extends TestCase class QueueTest extends TestCase
{ {
public function setUp() public function setUp(): void
{ {
parent::setUp(); parent::setUp();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class RelationsTest extends TestCase class RelationsTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
Mockery::close(); Mockery::close();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class SchemaTest extends TestCase class SchemaTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
Schema::drop('newcollection'); Schema::drop('newcollection');
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class SeederTest extends TestCase class SeederTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
User::truncate(); User::truncate();
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class ValidationTest extends TestCase class ValidationTest extends TestCase
{ {
public function tearDown() public function tearDown(): void
{ {
User::truncate(); User::truncate();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment