Skip to content

Commit

Permalink
feat: add DB facade stub
Browse files Browse the repository at this point in the history
  • Loading branch information
canvural committed Jan 21, 2021
1 parent 7e1919d commit 8aa4b6d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stubs/Facades.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

namespace Illuminate\Support\Facades;

abstract class Facade {}

/**
* @mixin \Redis
* @mixin \Illuminate\Redis\RedisManager
* @mixin \Illuminate\Contracts\Redis\Factory
*/
class Redis
{}
class Redis {}

/**
* @mixin \Illuminate\Database\DatabaseManager
* @mixin \Illuminate\Database\Connection
* @mixin \Illuminate\Database\ConnectionInterface
*/
class DB extends Facade {}
13 changes: 13 additions & 0 deletions tests/Features/Methods/Facades.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Tests\Features\Methods;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Redis;

Expand Down Expand Up @@ -48,4 +49,16 @@ public function testRedisHmget(): array
{
return Redis::hmget('h', ['field1', 'field2']);
}

public function testDBQuery(): \Illuminate\Database\Query\Builder
{
return DB::query();
}

public function testDBAfterCommit(): void
{
DB::afterCommit(function() {

});
}
}

0 comments on commit 8aa4b6d

Please sign in to comment.