Flugg\Responder\Tests\TestCase::makeModelWithResourceKey PHP Method

makeModelWithResourceKey() protected method

Makes a new empty model with a resource key set.
protected makeModelWithResourceKey ( string $resourceKey ) : Model
$resourceKey string
return Illuminate\Database\Eloquent\Model
    protected function makeModelWithResourceKey(string $resourceKey) : Model
    {
        $this->app->bind('tests.resource_key', function () use($resourceKey) {
            return $resourceKey;
        });
        return new class extends Model
        {
            public static function getResourceKey()
            {
                return app('tests.resource_key');
            }
        };
    }