Skip to content

Commit

Permalink
use trigger_warning, suppress in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondeJK committed Aug 12, 2024
1 parent 7f4945f commit dc59e1c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
56 changes: 28 additions & 28 deletions test/Meetings/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function setUp(): void
->setClient($this->vonageClient->reveal())
->setAuthHandlers(new KeypairHandler())
->setBaseUrl('https://api-eu.vonage.com/v1/meetings');
$this->meetingsClient = new MeetingsClient($this->api);
$this->meetingsClient = @new MeetingsClient($this->api);
}

public function testBaseUrlIsSet(): void
Expand All @@ -79,7 +79,7 @@ public function testWillGetAvailableRooms(): void
return true;
}))->willReturn($this->getResponse('get-rooms-success'));

$response = $this->meetingsClient->getAllListedRooms();
$response = @$this->meetingsClient->getAllListedRooms();
$this->assertCount(2, $response);

foreach ($response as $room) {
Expand All @@ -99,7 +99,7 @@ public function testWillGetAvailableRoomsWithFilter(): void
return true;
}))->willReturn($this->getResponse('get-rooms-success'));

$response = $this->meetingsClient->getAllListedRooms('999', '234');
$response = @$this->meetingsClient->getAllListedRooms('999', '234');
$this->assertCount(2, $response);

foreach ($response as $room) {
Expand All @@ -123,7 +123,7 @@ public function testWillCreateRoom(): void
$room = new Room();
$room->fromArray(['display_name' => 'test-room']);

$response = $this->meetingsClient->createRoom($room);
$response = @$this->meetingsClient->createRoom($room);
$this->assertInstanceOf(Room::class, $response);

$this->assertEquals('test-room', $response->display_name);
Expand All @@ -150,7 +150,7 @@ public function testWillCreateLongTermRoom(): void
'expires_at' => '2023-01-30T00:47:04+0000'
]);

$response = $this->meetingsClient->createRoom($room);
$response = @$this->meetingsClient->createRoom($room);
$this->assertInstanceOf(Room::class, $response);

$this->assertEquals('test-room', $response->display_name);
Expand All @@ -176,7 +176,7 @@ public function testClientWillHandleUnauthorizedRequests(): void
$room = new Room();
$room->fromArray(['display_name' => 'something']);

$response = $this->meetingsClient->createRoom($room);
$response = @$this->meetingsClient->createRoom($room);
}

public function testClientWillHandleNotFoundResponse(): void
Expand All @@ -193,7 +193,7 @@ public function testClientWillHandleNotFoundResponse(): void
}))->willReturn($this->getResponse('empty', 404));
$this->expectException(NotFound::class);
$this->expectExceptionMessage('No resource found');
$response = $this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
$response = @$this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
}

public function testClientWillHandleValidationError(): void
Expand All @@ -214,7 +214,7 @@ public function testClientWillHandleValidationError(): void
$room = new Room();
$room->fromArray(['display_name' => 'test-room']);

$response = $this->meetingsClient->createRoom($room);
$response = @$this->meetingsClient->createRoom($room);
}

public function testWillGetRoomDetails(): void
Expand All @@ -230,7 +230,7 @@ public function testWillGetRoomDetails(): void
return true;
}))->willReturn($this->getResponse('get-room-success'));

$response = $this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
$response = @$this->meetingsClient->getRoom('224d6219-dc05-4c09-9d42-96adce7fcb67');
$this->assertInstanceOf(Room::class, $response);
$this->assertEquals('224d6219-dc05-4c09-9d42-96adce7fcb67', $response->id);
}
Expand Down Expand Up @@ -263,7 +263,7 @@ public function testWillUpdateExistingRoom(): void
]
];

$response = $this->meetingsClient->updateRoom('e857c5ce-cdee-4971-ab20-208a98263282', $payload);
$response = @$this->meetingsClient->updateRoom('e857c5ce-cdee-4971-ab20-208a98263282', $payload);
$this->assertInstanceOf(Room::class, $response);
$this->assertEquals('custom', $response->initial_join_options['microphone_state']);
$this->assertEquals('https://my-callback-url', $response->callback_urls['rooms_callback_url']);
Expand All @@ -284,7 +284,7 @@ public function testWillGetRecording(): void
return true;
}))->willReturn($this->getResponse('get-recording-success'));

$response = $this->meetingsClient->getRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
$response = @$this->meetingsClient->getRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
$this->assertInstanceOf(Recording::class, $response);
$this->assertEquals('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885', $response->id);
}
Expand All @@ -304,7 +304,7 @@ public function testWillDeleteRecording(): void
return true;
}))->willReturn($this->getResponse('empty', 204));

$response = $this->meetingsClient->deleteRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
$response = @$this->meetingsClient->deleteRecording('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
$this->assertTrue($response);
}

Expand All @@ -323,7 +323,7 @@ public function testWillGetRecordingsFromSession(): void
return true;
}))->willReturn($this->getResponse('get-recordings-success'));

$response = $this->meetingsClient->getRecordingsFromSession('2_MX40NjMwODczMn5-MTU3NTgyODEwNzQ2MH5OZDJrVmdBRUNDbG5MUzNqNXgya20yQ1Z-fg');
$response = @$this->meetingsClient->getRecordingsFromSession('2_MX40NjMwODczMn5-MTU3NTgyODEwNzQ2MH5OZDJrVmdBRUNDbG5MUzNqNXgya20yQ1Z-fg');

foreach ($response as $recording) {
$this->assertInstanceOf(Recording::class, $recording);
Expand All @@ -345,7 +345,7 @@ public function testWillGetMeetingDialNumbers(): void
return true;
}))->willReturn($this->getResponse('get-dialin-success'));

$response = $this->meetingsClient->getDialInNumbers();
$response = @$this->meetingsClient->getDialInNumbers();

foreach ($response as $dialInNumber) {
$this->assertInstanceOf(DialInNumber::class, $dialInNumber);
Expand All @@ -367,7 +367,7 @@ public function testWillGetApplicationThemes(): void
return true;
}))->willReturn($this->getResponse('get-application-themes-success'));

$response = $this->meetingsClient->getApplicationThemes();
$response = @$this->meetingsClient->getApplicationThemes();

foreach ($response as $applicationThemes) {
$this->assertInstanceOf(ApplicationTheme::class, $applicationThemes);
Expand All @@ -388,7 +388,7 @@ public function testWillCreateTheme(): void
return true;
}))->willReturn($this->getResponse('create-theme-success', 201));

$response = $this->meetingsClient->createApplicationTheme('My-Theme');
$response = @$this->meetingsClient->createApplicationTheme('My-Theme');
$this->assertInstanceOf(ApplicationTheme::class, $response);

$this->assertEquals('My-Theme', $response->theme_name);
Expand All @@ -410,7 +410,7 @@ public function testWillHandleConflictErrorOnThemeCreation(): void

$this->expectException(Conflict::class);
$this->expectExceptionMessage('Entity conflict');
$response = $this->meetingsClient->createApplicationTheme('My-Theme');
$response = @$this->meetingsClient->createApplicationTheme('My-Theme');
}

public function testWillGetThemeById(): void
Expand All @@ -425,7 +425,7 @@ public function testWillGetThemeById(): void
return true;
}))->willReturn($this->getResponse('get-theme-success'));

$response = $this->meetingsClient->getThemeById('afb5b1f2-fe83-4b14-83ff-f23f5630c160');
$response = @$this->meetingsClient->getThemeById('afb5b1f2-fe83-4b14-83ff-f23f5630c160');
$this->assertInstanceOf(ApplicationTheme::class, $response);
$this->assertEquals('afb5b1f2-fe83-4b14-83ff-f23f5630c160', $response->theme_id);
}
Expand All @@ -442,7 +442,7 @@ public function testWillDeleteTheme(): void
return true;
}))->willReturn($this->getResponse('empty', 204));

$response = $this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
$response = @$this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885');
$this->assertTrue($response);
}

Expand All @@ -458,7 +458,7 @@ public function testWillForceDeleteTheme(): void
return true;
}))->willReturn($this->getResponse('empty', 204));

$response = $this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885', true);
$response = @$this->meetingsClient->deleteTheme('2dbd1cf7-afbb-45d8-9fb6-9e95ce2f8885', true);
$this->assertTrue($response);
}

Expand All @@ -483,7 +483,7 @@ public function testWillUpdateThemeById(): void
]
];

$response = $this->meetingsClient->updateTheme('afb5b1f2-fe83-4b14-83ff-f23f5630c160', $payload);
$response = @$this->meetingsClient->updateTheme('afb5b1f2-fe83-4b14-83ff-f23f5630c160', $payload);
$this->assertInstanceOf(ApplicationTheme::class, $response);
$this->assertEquals('Updated Theme', $response->theme_name);
$this->assertEquals('Updated Branding', $response->brand_text);
Expand All @@ -508,9 +508,9 @@ public function testWillExtractCorrectImageKey($logoType, $validCall): void
}
}))->willReturn($this->getResponse('get-upload-urls-success'));

$uploadUrls = $this->meetingsClient->getUploadUrls();
$uploadUrls = @$this->meetingsClient->getUploadUrls();

$entity = $this->meetingsClient->returnCorrectUrlEntityFromType($uploadUrls, $logoType);
$entity = @$this->meetingsClient->returnCorrectUrlEntityFromType($uploadUrls, $logoType);

if ($validCall) {
$this->assertEquals($logoType, $entity->fields['logoType']);
Expand Down Expand Up @@ -559,7 +559,7 @@ public function testWillUploadImageToAws(): void
$this->vonageClient->getHttpClient()->willReturn($httpClient);

$file = __DIR__ . '/Fixtures/vonage.png';
$this->meetingsClient->uploadImage('afb5b1f2-fe83-4b14-83ff-f23f5630c160', 'white', $file);
@$this->meetingsClient->uploadImage('afb5b1f2-fe83-4b14-83ff-f23f5630c160', 'white', $file);
}

public function testCanGetUploadUrlsForThemeLogo(): void
Expand All @@ -574,7 +574,7 @@ public function testCanGetUploadUrlsForThemeLogo(): void
return true;
}))->willReturn($this->getResponse('get-upload-urls-success'));

$response = $this->meetingsClient->getUploadUrls();
$response = @$this->meetingsClient->getUploadUrls();
$this->assertEquals('auto-expiring-temp/logos/white/ca63a155-d5f0-4131-9903-c59907e53df0', $response[0]->fields['key']);
}

Expand All @@ -590,7 +590,7 @@ public function testWillGetRoomsAssociatedWithTheme(): void
return true;
}))->willReturn($this->getResponse('get-rooms-by-theme-id-success'));

$response = $this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888');
$response = @$this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888');

foreach ($response as $room) {
$this->assertInstanceOf(Room::class, $room);
Expand All @@ -609,7 +609,7 @@ public function testWillGetRoomsAssociatedWithThemeUsingFilter(): void
return true;
}))->willReturn($this->getResponse('get-rooms-by-theme-id-success'));

$response = $this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888', startId: '245', endId: '765');
$response = @$this->meetingsClient->getRoomsByThemeId('323867d7-8c4b-4dce-8c11-48f14425d888', startId: '245', endId: '765');

foreach ($response as $room) {
$this->assertInstanceOf(Room::class, $room);
Expand All @@ -633,7 +633,7 @@ public function testWillUpdateExistingApplication(): void
'default_theme_id' => '323867d7-8c4b-4dce-8c11-48f14425d888',
];

$response = $this->meetingsClient->updateApplication($payload);
$response = @$this->meetingsClient->updateApplication($payload);
$this->assertInstanceOf(Application::class, $response);
$this->assertEquals('f4d5a07b-260c-4458-b16c-e5a68553bc85', $response->application_id);
$this->assertEquals('323867d7-8c4b-4dce-8c11-48f14425d888', $response->default_theme_id);
Expand Down
8 changes: 4 additions & 4 deletions test/ProactiveConnect/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function setUp(): void
->setAuthHandlers(new Client\Credentials\Handler\KeypairHandler())
->setBaseUrl('https://api-eu.vonage.com/v0.1/bulk');

$this->proactiveConnectClient = new ProactiveConnectClient($this->api);
$this->proactiveConnectClient = @new ProactiveConnectClient($this->api);
}

public function testHasSetupClientCorrectly(): void
Expand All @@ -77,7 +77,7 @@ public function testSetsRequestAuthCorrectly(): void
return true;
}))->willReturn($this->getResponse('list-success'));

$list = $this->proactiveConnectClient->getLists();
$list = @$this->proactiveConnectClient->getLists();
$this->assertInstanceOf(IterableAPICollection::class, $list);
$list->getPageData();
}
Expand All @@ -94,9 +94,9 @@ public function testListUrlEndpoint(): void
return true;
}))->willReturn($this->getResponse('list-success'));

$list = $this->proactiveConnectClient->getLists();
$list = @$this->proactiveConnectClient->getLists();
$this->assertInstanceOf(IterableAPICollection::class, $list);
$list->getPageData();
@$list->getPageData();
}

public function testCanGetList(): void
Expand Down

0 comments on commit dc59e1c

Please sign in to comment.