instances added god may help
This commit is contained in:
32
tests/Service/Settings/SettingGatewayTest.php
Normal file
32
tests/Service/Settings/SettingGatewayTest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Tests\Service\Settings;
|
||||
|
||||
use MintyPHP\Service\Settings\SettingGateway;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SettingGatewayTest extends TestCase
|
||||
{
|
||||
public function testGetDefaultTenantIdDelegatesToService(): void
|
||||
{
|
||||
$settingService = $this->createMock('MintyPHP\\Service\\Settings\\SettingService');
|
||||
$settingService->expects($this->once())
|
||||
->method('getDefaultTenantId')
|
||||
->willReturn(42);
|
||||
|
||||
$gateway = new SettingGateway($settingService);
|
||||
$this->assertSame(42, $gateway->getDefaultTenantId());
|
||||
}
|
||||
|
||||
public function testSetDefaultRoleIdDelegatesToService(): void
|
||||
{
|
||||
$settingService = $this->createMock('MintyPHP\\Service\\Settings\\SettingService');
|
||||
$settingService->expects($this->once())
|
||||
->method('setDefaultRoleId')
|
||||
->with(7, null)
|
||||
->willReturn(true);
|
||||
|
||||
$gateway = new SettingGateway($settingService);
|
||||
$this->assertTrue($gateway->setDefaultRoleId(7));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user