DocumentQueryTest.php 3.1 KB

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