mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 19:22:14 +01:00
Added php-cs-fixer rule void_return
This commit is contained in:
committed by
Gregor Vostrak
parent
a820d8540f
commit
2e8da98287
@@ -112,7 +112,7 @@ class RegistrationTest extends TestCase
|
||||
public function test_new_users_can_register_and_uses_ip_lookup_service_to_get_information_about_currency_and_start_of_week(): void
|
||||
{
|
||||
// Arrange
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock) {
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock): void {
|
||||
$mock->shouldReceive('lookup')->andReturn(new IpLookupResponseDto(
|
||||
'America/New_York',
|
||||
Weekday::Sunday,
|
||||
@@ -143,7 +143,7 @@ class RegistrationTest extends TestCase
|
||||
public function test_new_users_can_register_and_uses_ip_lookup_service_to_get_information_about_timezone_if_client_did_not_send_one(): void
|
||||
{
|
||||
// Arrange
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock) {
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock): void {
|
||||
$mock->shouldReceive('lookup')->andReturn(new IpLookupResponseDto(
|
||||
'America/New_York',
|
||||
Weekday::Sunday,
|
||||
@@ -174,7 +174,7 @@ class RegistrationTest extends TestCase
|
||||
public function test_new_users_can_register_and_uses_ip_lookup_service_to_get_information_about_timezone_if_client_sends_invalid_one(): void
|
||||
{
|
||||
// Arrange
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock) {
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock): void {
|
||||
$mock->shouldReceive('lookup')->andReturn(new IpLookupResponseDto(
|
||||
'America/New_York',
|
||||
Weekday::Sunday,
|
||||
@@ -205,7 +205,7 @@ class RegistrationTest extends TestCase
|
||||
public function test_new_users_can_register_and_legacy_timezone_from_client_is_mapped_to_new_timezone(): void
|
||||
{
|
||||
// Arrange
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock) {
|
||||
$this->mock(IpLookupServiceContract::class, function ($mock): void {
|
||||
$mock->shouldReceive('lookup')->andReturn(new IpLookupResponseDto(
|
||||
'America/New_York',
|
||||
Weekday::Sunday,
|
||||
|
||||
@@ -25,7 +25,7 @@ abstract class TestCase extends BaseTestCase
|
||||
parent::setUp();
|
||||
Mail::fake();
|
||||
LogFake::bind();
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock) {
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('hasSubscription')->andReturn(false);
|
||||
$mock->shouldReceive('hasTrial')->andReturn(false);
|
||||
$mock->shouldReceive('getTrialUntil')->andReturn(null);
|
||||
|
||||
@@ -16,7 +16,7 @@ use PHPUnit\Framework\Attributes\UsesClass;
|
||||
#[UsesClass(ImportController::class)]
|
||||
class ImportEndpointTest extends ApiEndpointTestAbstract
|
||||
{
|
||||
public function test_index_fails_if_user_does_not_have_permission()
|
||||
public function test_index_fails_if_user_does_not_have_permission(): void
|
||||
{
|
||||
// Arrange
|
||||
$data = $this->createUserWithPermission();
|
||||
@@ -30,7 +30,7 @@ class ImportEndpointTest extends ApiEndpointTestAbstract
|
||||
$response->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_index_returns_importers_if_user_has_permission()
|
||||
public function test_index_returns_importers_if_user_has_permission(): void
|
||||
{
|
||||
// Arrange
|
||||
$data = $this->createUserWithPermission([
|
||||
@@ -58,7 +58,7 @@ class ImportEndpointTest extends ApiEndpointTestAbstract
|
||||
$this->assertSame(__('importer.toggl_time_entries.description'), $toggleTimeEntries['description']);
|
||||
}
|
||||
|
||||
public function test_import_fails_if_user_does_not_have_permission()
|
||||
public function test_import_fails_if_user_does_not_have_permission(): void
|
||||
{
|
||||
// Arrange
|
||||
$data = $this->createUserWithPermission();
|
||||
|
||||
@@ -118,7 +118,7 @@ class MemberEndpointTest extends ApiEndpointTestAbstract
|
||||
$data = $this->createUserWithPermission([
|
||||
'members:update',
|
||||
]);
|
||||
$this->mock(BillableRateService::class, function (MockInterface $mock) use ($data) {
|
||||
$this->mock(BillableRateService::class, function (MockInterface $mock) use ($data): void {
|
||||
$mock->shouldReceive('updateTimeEntriesBillableRateForMember')
|
||||
->once()
|
||||
->withArgs(fn (Member $memberArg) => $memberArg->is($data->member) && $memberArg->billable_rate === 10001);
|
||||
|
||||
@@ -131,7 +131,7 @@ class OrganizationEndpointTest extends ApiEndpointTestAbstract
|
||||
]);
|
||||
$billableRate = 111;
|
||||
$organizationFake = Organization::factory()->billableRate($billableRate)->make();
|
||||
$this->mock(BillableRateService::class, function (MockInterface $mock) use ($data, $billableRate) {
|
||||
$this->mock(BillableRateService::class, function (MockInterface $mock) use ($data, $billableRate): void {
|
||||
$mock->shouldReceive('updateTimeEntriesBillableRateForOrganization')
|
||||
->once()
|
||||
->withArgs(fn (Organization $organization) => $organization->is($data->organization) && $organization->billable_rate === $billableRate);
|
||||
|
||||
@@ -42,7 +42,7 @@ class CheckOrganizationBlockedMiddlewareTest extends MiddlewareTestAbstract
|
||||
// Arrange
|
||||
$user = $this->createUserWithPermission();
|
||||
$this->createTestRoute();
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock) {
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('isBlocked')->andReturn(true)->once();
|
||||
});
|
||||
Passport::actingAs($user->user);
|
||||
@@ -60,7 +60,7 @@ class CheckOrganizationBlockedMiddlewareTest extends MiddlewareTestAbstract
|
||||
// Arrange
|
||||
$user = $this->createUserWithPermission();
|
||||
$this->createTestRoute();
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock) {
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('isBlocked')->never();
|
||||
});
|
||||
Passport::actingAs($user->user);
|
||||
@@ -77,7 +77,7 @@ class CheckOrganizationBlockedMiddlewareTest extends MiddlewareTestAbstract
|
||||
// Arrange
|
||||
$user = $this->createUserWithPermission();
|
||||
$route = $this->createTestRouteNoModelBinding();
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock) {
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('isBlocked')->never();
|
||||
});
|
||||
Passport::actingAs($user->user);
|
||||
@@ -94,7 +94,7 @@ class CheckOrganizationBlockedMiddlewareTest extends MiddlewareTestAbstract
|
||||
// Arrange
|
||||
$user = $this->createUserWithPermission();
|
||||
$this->createTestRoute();
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock) {
|
||||
$this->mock(BillingContract::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('isBlocked')->andReturn(false)->once();
|
||||
});
|
||||
Passport::actingAs($user->user);
|
||||
|
||||
Reference in New Issue
Block a user