Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 13, 2021
1 parent 02e7f66 commit cd6dc5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/Contracts/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,4 @@ public function modelName(): string;
* Get table prefix.
*/
public function tablePrefix(): string;

/**
* Set tenant as default database connection and get the connection name.
*/
public function asDefaultConnection(Model $entity, ?string $database): ?string;
}
14 changes: 4 additions & 10 deletions tests/Unit/Console/TinkerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,14 @@ public function testTinkerWithTwoDriversWithTwoArguments()

$model = m::mock(Model::class);

$model->shouldReceive('findOrFail')
->with('1');
$model->shouldReceive('findOrFail')->with('1');

$factory = $this->getMockDriverFactory();

$factory->shouldReceive('model')
->andReturn($model);
$factory->shouldReceive('model')->andReturn($model)
->shouldReceive('asDefaultConnection')->withAnyArgs();

$factory->shouldReceive('asDefaultConnection')
->withAnyArgs();

$tenanti->shouldReceive('driver')
->with('tenant2')
->andReturn($factory);
$tenanti->shouldReceive('driver')->with('tenant2')->andReturn($factory);

$command = m::mock('Orchestra\Tenanti\Console\TinkerCommand[call]', [$tenanti]);
$command->shouldReceive('call');
Expand Down

0 comments on commit cd6dc5d

Please sign in to comment.