@@ -278,6 +278,149 @@ public function testAddTrackChairAndAddCategory(){
278278 $ this ->assertTrue (count ($ track_chair ->categories ) == 2 );
279279 }
280280
281+ public function testGetAllTrackChairsCSV (){
282+ $ params = [
283+ 'id ' => self ::$ summit ->getId (),
284+ ];
285+
286+ $ headers = [
287+ "HTTP_Authorization " => " Bearer " . $ this ->access_token ,
288+ "CONTENT_TYPE " => "application/json "
289+ ];
290+
291+ $ response = $ this ->action (
292+ "GET " ,
293+ "OAuth2SummitTrackChairsApiController@getAllBySummitCSV " ,
294+ $ params ,
295+ [],
296+ [],
297+ [],
298+ $ headers
299+ );
300+
301+ $ this ->assertResponseStatus (200 );
302+ $ content = $ response ->getContent ();
303+ $ this ->assertNotEmpty ($ content );
304+ }
305+
306+ public function testGetTrackChairById (){
307+
308+ $ params = [
309+ 'id ' => self ::$ summit ->getId (),
310+ 'expand ' => 'member,categories '
311+ ];
312+
313+ $ data = [
314+ 'member_id ' => self ::$ member2 ->getId (),
315+ 'categories ' => [self ::$ defaultTrack ->getId ()]
316+ ];
317+
318+ $ headers = [
319+ "HTTP_Authorization " => " Bearer " . $ this ->access_token ,
320+ "CONTENT_TYPE " => "application/json "
321+ ];
322+
323+ $ response = $ this ->action (
324+ "POST " ,
325+ "OAuth2SummitTrackChairsApiController@add " ,
326+ $ params ,
327+ [],
328+ [],
329+ [],
330+ $ headers ,
331+ json_encode ($ data )
332+ );
333+
334+ $ content = $ response ->getContent ();
335+ $ this ->assertResponseStatus (201 );
336+ $ track_chair = json_decode ($ content );
337+ $ this ->assertTrue (!is_null ($ track_chair ));
338+
339+ // now get by id
340+ $ params = [
341+ 'id ' => self ::$ summit ->getId (),
342+ 'track_chair_id ' => $ track_chair ->id ,
343+ 'expand ' => 'member,categories '
344+ ];
345+
346+ $ headers = [
347+ "HTTP_Authorization " => " Bearer " . $ this ->access_token ,
348+ "CONTENT_TYPE " => "application/json "
349+ ];
350+
351+ $ response = $ this ->action (
352+ "GET " ,
353+ "OAuth2SummitTrackChairsApiController@get " ,
354+ $ params ,
355+ [],
356+ [],
357+ [],
358+ $ headers
359+ );
360+
361+ $ content = $ response ->getContent ();
362+ $ this ->assertResponseStatus (200 );
363+ $ track_chair_fetched = json_decode ($ content );
364+ $ this ->assertTrue (!is_null ($ track_chair_fetched ));
365+ $ this ->assertEquals ($ track_chair ->id , $ track_chair_fetched ->id );
366+ }
367+
368+ public function testDeleteTrackChair (){
369+
370+ $ params = [
371+ 'id ' => self ::$ summit ->getId (),
372+ ];
373+
374+ $ data = [
375+ 'member_id ' => self ::$ member2 ->getId (),
376+ 'categories ' => [self ::$ defaultTrack ->getId ()]
377+ ];
378+
379+ $ headers = [
380+ "HTTP_Authorization " => " Bearer " . $ this ->access_token ,
381+ "CONTENT_TYPE " => "application/json "
382+ ];
383+
384+ $ response = $ this ->action (
385+ "POST " ,
386+ "OAuth2SummitTrackChairsApiController@add " ,
387+ $ params ,
388+ [],
389+ [],
390+ [],
391+ $ headers ,
392+ json_encode ($ data )
393+ );
394+
395+ $ content = $ response ->getContent ();
396+ $ this ->assertResponseStatus (201 );
397+ $ track_chair = json_decode ($ content );
398+ $ this ->assertTrue (!is_null ($ track_chair ));
399+
400+ // now delete
401+ $ params = [
402+ 'id ' => self ::$ summit ->getId (),
403+ 'track_chair_id ' => $ track_chair ->id ,
404+ ];
405+
406+ $ headers = [
407+ "HTTP_Authorization " => " Bearer " . $ this ->access_token ,
408+ "CONTENT_TYPE " => "application/json "
409+ ];
410+
411+ $ response = $ this ->action (
412+ "DELETE " ,
413+ "OAuth2SummitTrackChairsApiController@delete " ,
414+ $ params ,
415+ [],
416+ [],
417+ [],
418+ $ headers
419+ );
420+
421+ $ this ->assertResponseStatus (204 );
422+ }
423+
281424 public function testAddTrackChairAndDeleteCategory (){
282425
283426 $ params = [
0 commit comments