QueryTest.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_Docs
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2014 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/Docs.php';
  23. require_once 'Zend/Gdata/Docs/Query.php';
  24. require_once 'Zend/Http/Client.php';
  25. /**
  26. * @category Zend
  27. * @package Zend_Gdata_Docs
  28. * @subpackage UnitTests
  29. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. * @group Zend_Gdata
  32. * @group Zend_Gdata_Docs
  33. */
  34. class Zend_Gdata_Docs_QueryTest extends PHPUnit_Framework_TestCase
  35. {
  36. public function setUp()
  37. {
  38. $this->docQuery = new Zend_Gdata_Docs_Query();
  39. }
  40. public function testTitle()
  41. {
  42. $this->assertTrue($this->docQuery->getTitle() == null);
  43. $this->docQuery->setTitle('test title');
  44. $this->assertTrue($this->docQuery->getTitle() == 'test title');
  45. $this->assertTrue($this->docQuery->getQueryString() == '?title=test+title');
  46. $this->docQuery->setTitle(null);
  47. $this->assertTrue($this->docQuery->getTitle() == null);
  48. }
  49. public function testTitleExact()
  50. {
  51. $this->assertTrue($this->docQuery->getTitleExact() == null);
  52. $this->docQuery->setTitleExact('test title');
  53. $this->assertTrue($this->docQuery->getTitleExact() == 'test title');
  54. $this->assertTrue($this->docQuery->getQueryString() == '?title-exact=test+title');
  55. $this->docQuery->setTitleExact(null);
  56. $this->assertTrue($this->docQuery->getTitleExact() == null);
  57. }
  58. public function testProjection()
  59. {
  60. $this->assertTrue($this->docQuery->getProjection() == 'full');
  61. $this->docQuery->setProjection('abc');
  62. $this->assertTrue($this->docQuery->getProjection() == 'abc');
  63. }
  64. public function testVisibility()
  65. {
  66. $this->assertTrue($this->docQuery->getVisibility() == 'private');
  67. $this->docQuery->setVisibility('xyz');
  68. $this->assertTrue($this->docQuery->getVisibility() == 'xyz');
  69. }
  70. }