PluginTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OCA\DAV\Tests\unit\CalDAV;
  22. use OCA\DAV\CalDAV\Plugin;
  23. use Test\TestCase;
  24. class PluginTest extends TestCase {
  25. /** @var Plugin */
  26. private $plugin;
  27. public function setUp() {
  28. parent::setUp();
  29. $this->plugin = new Plugin();
  30. }
  31. public function linkProvider() {
  32. return [
  33. [
  34. 'principals/users/MyUserName',
  35. 'calendars/MyUserName',
  36. ],
  37. [
  38. 'FooFoo',
  39. null,
  40. ],
  41. ];
  42. }
  43. /**
  44. * @dataProvider linkProvider
  45. *
  46. * @param $input
  47. * @param $expected
  48. */
  49. public function testGetCalendarHomeForPrincipal($input, $expected) {
  50. $this->assertSame($expected, $this->plugin->getCalendarHomeForPrincipal($input));
  51. }
  52. }