DocumentQueryTest.php 2.8 KB

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