EventQueryExceptionTest.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Gdata_Calendar
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id $
  21. */
  22. require_once 'Zend/Gdata/Calendar.php';
  23. require_once 'Zend/Gdata/Calendar/EventQuery.php';
  24. require_once 'Zend/Http/Client.php';
  25. require_once 'PHPUnit/Framework/TestCase.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Gdata_Calendar
  29. * @subpackage UnitTests
  30. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. * @group Zend_Gdata
  33. * @group Zend_Gdata_Calendar
  34. */
  35. class Zend_Gdata_Calendar_EventQueryExceptionTest extends PHPUnit_Framework_TestCase
  36. {
  37. const GOOGLE_DEVELOPER_CALENDAR = 'developer-calendar@google.com';
  38. public function setUp()
  39. {
  40. $this->query = new Zend_Gdata_Calendar_EventQuery();
  41. }
  42. /**
  43. * @expectedException Zend_Gdata_App_Exception
  44. */
  45. public function testSingleEventsThrowsExceptionOnSetInvalidValue()
  46. {
  47. $this->query->resetParameters();
  48. $singleEvents = 'puppy';
  49. $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR);
  50. $this->query->setSingleEvents($singleEvents);
  51. }
  52. /**
  53. * @expectedException Zend_Gdata_App_Exception
  54. */
  55. public function testFutureEventsThrowsExceptionOnSetInvalidValue()
  56. {
  57. $this->query->resetParameters();
  58. $futureEvents = 'puppy';
  59. $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR);
  60. $this->query->setFutureEvents($futureEvents);
  61. }
  62. }