Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/OpenViduTest.php
Show All 12 Lines | class OpenViduTest extends TestCase | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
*/ | */ | ||||
public function setUp(): void | public function setUp(): void | ||||
{ | { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->clearMeetEntitlements(); | $this->clearMeetEntitlements(); | ||||
$room = Room::where('name', 'john')->first(); | $room = Room::where('name', 'john')->first(); | ||||
$room->setSettings(['password' => null, 'locked' => null]); | $room->setSettings(['password' => null, 'locked' => null, 'nomedia' => null]); | ||||
} | } | ||||
public function tearDown(): void | public function tearDown(): void | ||||
{ | { | ||||
$this->clearMeetEntitlements(); | $this->clearMeetEntitlements(); | ||||
$room = Room::where('name', 'john')->first(); | $room = Room::where('name', 'john')->first(); | ||||
$room->setSettings(['password' => null, 'locked' => null]); | $room->setSettings(['password' => null, 'locked' => null, 'nomedia' => null]); | ||||
parent::tearDown(); | parent::tearDown(); | ||||
} | } | ||||
/** | /** | ||||
* Test listing user rooms | * Test listing user rooms | ||||
* | * | ||||
* @group openvidu | * @group openvidu | ||||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | public function testJoinRoom(): void | ||||
$this->assertSame($session_id, $json['session']); | $this->assertSame($session_id, $json['session']); | ||||
// Make sure the room owner can access the password protected room w/o password | // Make sure the room owner can access the password protected room w/o password | ||||
// TODO: Test without init=1 | // TODO: Test without init=1 | ||||
$post = ['init' => 'init']; | $post = ['init' => 'init']; | ||||
$response = $this->actingAs($john)->post("api/v4/openvidu/rooms/{$room->name}", $post); | $response = $this->actingAs($john)->post("api/v4/openvidu/rooms/{$room->name}", $post); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
// Test 'nomedia' room option | |||||
$room->setSettings(['nomedia' => 'true', 'password' => null]); | |||||
$post = ['init' => 'init', 'canPublish' => true]; | |||||
$response = $this->actingAs($john)->post("api/v4/openvidu/rooms/{$room->name}", $post); | |||||
$response->assertStatus(200); | |||||
$json = $response->json(); | |||||
$this->assertSame(Room::ROLE_PUBLISHER & $json['role'], Room::ROLE_PUBLISHER); | |||||
$post = ['init' => 'init', 'canPublish' => true]; | |||||
$response = $this->actingAs($jack)->post("api/v4/openvidu/rooms/{$room->name}", $post); | |||||
$response->assertStatus(200); | |||||
$json = $response->json(); | |||||
$this->assertSame(Room::ROLE_PUBLISHER & $json['role'], 0); | |||||
} | } | ||||
/** | /** | ||||
* Test locked room and join requests | * Test locked room and join requests | ||||
* | * | ||||
* @group openvidu | * @group openvidu | ||||
*/ | */ | ||||
public function testJoinRequests(): void | public function testJoinRequests(): void | ||||
▲ Show 20 Lines • Show All 561 Lines • Show Last 20 Lines |