PageRenderTime 75ms CodeModel.GetById 10ms RepoModel.GetById 2ms app.codeStats 0ms

/package/app/app/tests/unitTests/partnerServices2/puserKuserDeprecation/puserKuserDeprecationTest.php

https://bitbucket.org/pandaos/kaltura
PHP | 94 lines | 51 code | 15 blank | 28 comment | 0 complexity | 7f91b10a80e51124d9137fee6f5826b6 MD5 | raw file
Possible License(s): AGPL-3.0, GPL-3.0, BSD-3-Clause, LGPL-2.1, GPL-2.0, LGPL-3.0, JSON, MPL-2.0-no-copyleft-exception, Apache-2.0
  1. <?php
  2. //Require server bootstrap
  3. require_once(dirname(__FILE__) . '/../../../bootstrap/bootstrapServer.php');
  4. /**
  5. *
  6. * Represents the puser_kuser table deprecation tests
  7. * @author Roni
  8. *
  9. */
  10. class puserKuserDeprecationTest extends KalturaServerTestCase
  11. {
  12. /**
  13. *
  14. * Creates a new puser kuser deprecarion Test case
  15. * @param string $name
  16. * @param array<unknown_type> $data
  17. * @param string $dataName
  18. */
  19. public function __construct($name = "puserKuserDeprecationTest", array $data = array(), $dataName ="Default data")
  20. {
  21. parent::__construct($name, $data, $dataName);
  22. }
  23. /**
  24. *
  25. * Tests all ps2 services for the given:
  26. * @var array $partnerData
  27. * @dataProvider provideData
  28. */
  29. public function testAllPS2Services(array $partnerData)
  30. {
  31. //TODO: finish this test!
  32. return;
  33. //Go over all SP2 services and see that we get the result (run after consulidation)
  34. //As all the ps2 services gets a puser_kuser as parameter.
  35. $ps2ActionsFolderPath = "C:/opt/kaltura/app/alpha/apps/kaltura/modules/partnerservices2/actions";
  36. chdir($ps2ActionsFolderPath);
  37. $ks = PS2Helper::getKs($partnerData["secret"], $partnerData["userId"], KalturaSessionType::ADMIN, $partnerData["partnerId"]);
  38. print ($ks);
  39. return;
  40. foreach (glob("*.php") as $ps2FileName)
  41. {
  42. //now get just the PS2 service name
  43. $ps2ActionArray = explode(".", $ps2FileName);
  44. $actionName = $ps2ActionArray[0];
  45. $actionName = str_replace("Action", "", $actionName );
  46. $params = array (
  47. 'user_id' => 1,
  48. "partner_id" =>$partnerData["partnerId"],
  49. "secret" =>$partnerData["secret"],
  50. );
  51. var_dump($partnerData["partnerId"]);
  52. $ks = "ZjA3N2I1ZTUxZWM0ZDg2MTQ3M2Y1NTg4YmUzNWQ1NWFhYTFmZTM1NXwtMjstMjsxMzAwMzgyNjcyOzI7MTMwMDI5NjI3Mi43NTIxO2FkbWluQGthbHR1cmEuY29tOyo7Ow==";
  53. $result = PS2Helper::doHttpRequest($actionName, $params, $ks);
  54. print(var_dump($result) . "\n");
  55. print($actionName . "\n");
  56. }
  57. }
  58. /**
  59. *
  60. * Provides the testAllPS2Services function with it's parameters
  61. */
  62. public function providerTestAllPS2Services()
  63. {
  64. $inputs = $this->provider("testAllPS2Services");
  65. $inputsForTest = array();
  66. foreach($inputs as $input)
  67. {
  68. $additionalData = $input[0]->getAdditionalData();
  69. $partnerDataArray = array("partnerId" => $additionalData["partnerId"],
  70. "secret" => $additionalData["secret"],
  71. "serviceUrl" => $additionalData["serviceUrl"],
  72. "isAdmin" => $additionalData["isAdmin"],
  73. "userId" => $additionalData["userId"],
  74. );
  75. $inputsForTest[] = array($partnerDataArray);
  76. }
  77. return $inputsForTest;
  78. }
  79. }