
** Get all presentations from selection Plan GET /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations filtering 'title' => ['=@', '=='], 'abstract' => ['=@', '=='], 'social_summary' => ['=@', '=='], 'tags' => ['=@', '=='], 'level' => ['=@', '=='], 'summit_type_id' => ['=='], 'event_type_id' => ['=='], 'track_id' => ['=='], 'speaker_id' => ['=='], 'speaker' => ['=@', '=='], 'speaker_email' => ['=@', '=='], 'selection_status' => ['=='], 'id' => ['=='], 'selection_plan_id' => ['=='], 'status' => ['=='], 'is_chair_visible' => ['=='], 'is_voting_visible' => ['=='], ** for track chairs app use 'filter' => 'status==Received,is_chair_visible==1', ordering track Scopes REALM_BASE_URL/summits/read AUTHZ super-admins administrators track-chairs track-chairs-admins ** Get individual Selection List GET /api/v1/summits/{id}/tracks/{track_id}/selection-lists/individual/owner/{owner_id} Scopes REALM_BASE_URL/summits/read AUTHZ super-admins administrators track-chairs track-chairs-admins ** Add to my individual Selection List POST /api/v1/summits/{id}/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id} where {collection} should be one of following: * selected * maybe * pass Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Remove From my individual selection list DELETE /api/v1/summits/{id}/tracks/{track_id}/selection-lists/individual/presentation-selections/{collection}/presentations/{presentation_id} where {collection} should be one of following: * selected * maybe * pass Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Get Team Selection List GET /api/v1/summits/{id}/tracks/{track_id}/selection-lists/team Scopes REALM_BASE_URL/summits/read AUTHZ super-admins administrators track-chairs track-chairs-admins ** Create team selection list POST /api/v1/summits/{id}/tracks/{track_id}/selection-lists/team Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Reorder list PUT /api/v1/summits/{id}/tracks/{track_id}/selection-lists/{list_id}/reorder payload hash => 'required|string' collection => 'required|string|in:selected,maybe' presentations => 'required|int_array' ( presentations ids) Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Get track chairs per Summit GET /api/v1/summits/{id}/track-chairs fitering 'member_first_name' => ['=@', '=='], 'member_last_name' => ['=@', '=='], 'member_full_name' => ['=@', '=='], 'member_email' => ['=@', '=='], 'member_id' => ['=='], 'track_id' => ['=='], 'summit_id' => ['=='] Scopes REALM_BASE_URL/summits/read AUTHZ super-admins administrators track-chairs track-chairs-admins ** Mark Presentation as viewed PUT /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/view Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Add Presentation Comment POST /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/comments Payload 'body' => 'required|string', 'is_public' => 'required|boolean', Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Get all Presention Category Change Request GET /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/all/category-change-requests filtering 'selection_plan_id' => ['=='], 'summit_id' => ['=='], 'new_category_id' => ['=='], 'old_category_id' => ['=='], 'new_category_title' => ['=@', '=='], 'old_category_title' => ['=@', '=='], 'requester_fullname' => ['=@', '=='], 'requester_email' => ['=@', '=='], 'aprover_fullname' => ['=@', '=='], 'aprover_email' => ['=@', '=='] ordering 'id', 'approval_date', 'status' Scopes REALM_BASE_URL/summits/read REALM_BASE_URL/summits/read/all AUTHZ super-admins administrators track-chairs track-chairs-admins ** Add Presentation Category change Request POST /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/category-change-requests payload 'new_category_id' => 'required|integer', Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Resolve Presentation Category change Request PUT /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/category-change-requests/{category_change_request_id} payload 'approved' => 'required|bool', 'reason' => 'sometimes|string', Scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs track-chairs-admins ** Add track chair POST /api/v1/summits/{id}/track-chairs Payload 'member_id' => 'required|int', 'categories' => 'required|int_array', scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs-admins ** Update track chair PUT /api/v1/summits/{id}/track-chairs/{track_chair_id} Payload 'categories' => 'required|int_array', scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs-admins ** Delete track chairs DELETE /api/v1/summits/{id}/track-chairs/{track_chair_id} scopes REALM_BASE_URL/summits/write AUTHZ super-admins administrators track-chairs-admins ** Get Track Chair by Id GET /api/v1/summits/{id}/track-chairs/{track_chair_id} scopes REALM_BASE_URL/summits/read AUTHZ super-admins administrators track-chairs-admins Change-Id: Iab0d77a6337a0db27c649dcafb1d90f09923df8a Signed-off-by: smarcet <smarcet@gmail.com>
111 lines
3.3 KiB
PHP
111 lines
3.3 KiB
PHP
<?php namespace Tests;
|
|
/**
|
|
* Copyright 2021 OpenStack Foundation
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
**/
|
|
use App\Models\Foundation\Main\IGroup;
|
|
/**
|
|
* Class OAuth2SummitTrackChairsApiTest
|
|
* @package Tests
|
|
*/
|
|
class OAuth2SummitTrackChairsApiTest extends \ProtectedApiTest
|
|
{
|
|
use \InsertSummitTestData;
|
|
|
|
use \InsertMemberTestData;
|
|
|
|
protected function setUp()
|
|
{
|
|
$this->setCurrentGroup(IGroup::TrackChairs);
|
|
parent::setUp();
|
|
self::insertTestData();
|
|
self::$summit_permission_group->addMember(self::$member);
|
|
self::$em->persist(self::$summit);
|
|
self::$em->persist(self::$summit_permission_group);
|
|
self::$em->flush();
|
|
$track_chair = self::$summit->addTrackChair(self::$member, [ self::$defaultTrack ] );
|
|
self::$em->persist(self::$summit);
|
|
self::$em->flush();
|
|
}
|
|
|
|
protected function tearDown()
|
|
{
|
|
self::clearTestData();
|
|
parent::tearDown();
|
|
}
|
|
|
|
public function testGetAllTrackChairsPerSummit(){
|
|
$params = [
|
|
'summit_id' => self::$summit->getId(),
|
|
'filter' => 'track_id=='.self::$defaultTrack->getId(),
|
|
'page' => 1,
|
|
'per_page' => 10,
|
|
'order' => '+id',
|
|
'expand' => 'member,categories'
|
|
];
|
|
|
|
$headers = [
|
|
"HTTP_Authorization" => " Bearer " . $this->access_token,
|
|
"CONTENT_TYPE" => "application/json"
|
|
];
|
|
|
|
$response = $this->action(
|
|
"GET",
|
|
"OAuth2SummitTrackChairsApiController@getAllBySummit",
|
|
$params,
|
|
[],
|
|
[],
|
|
[],
|
|
$headers
|
|
);
|
|
|
|
$content = $response->getContent();
|
|
$this->assertResponseStatus(200);
|
|
$track_chairs = json_decode($content);
|
|
$this->assertTrue(!is_null($track_chairs));
|
|
$this->assertTrue($track_chairs->total == 1);
|
|
return $track_chairs;
|
|
}
|
|
|
|
public function testAddTrackChair(){
|
|
$params = [
|
|
'id' => self::$summit->getId(),
|
|
'expand' => 'member,categories'
|
|
];
|
|
|
|
$data = [
|
|
'member_id' => self::$member2->getId(),
|
|
'categories' => [self::$defaultTrack->getId()]
|
|
];
|
|
|
|
$headers = [
|
|
"HTTP_Authorization" => " Bearer " . $this->access_token,
|
|
"CONTENT_TYPE" => "application/json"
|
|
];
|
|
|
|
$response = $this->action(
|
|
"POST",
|
|
"OAuth2SummitTrackChairsApiController@add",
|
|
$params,
|
|
[],
|
|
[],
|
|
[],
|
|
$headers,
|
|
json_encode($data)
|
|
);
|
|
|
|
$content = $response->getContent();
|
|
$this->assertResponseStatus(201);
|
|
$track_chair = json_decode($content);
|
|
$this->assertTrue(!is_null($track_chair));
|
|
}
|
|
|
|
} |