2
0

ItemQueryTest.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_Gbase
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2012 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/Gbase.php';
  23. require_once 'Zend/Gdata/Gbase/ItemQuery.php';
  24. require_once 'Zend/Http/Client.php';
  25. /**
  26. * @category Zend
  27. * @package Zend_Gdata_Gbase
  28. * @subpackage UnitTests
  29. * @copyright Copyright (c) 2005-2012 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_Gbase
  33. */
  34. class Zend_Gdata_Gbase_ItemQueryTest extends PHPUnit_Framework_TestCase
  35. {
  36. public function setUp()
  37. {
  38. $this->itemQuery = new Zend_Gdata_Gbase_ItemQuery();
  39. }
  40. public function testBq()
  41. {
  42. $this->itemQuery->resetParameters();
  43. $this->itemQuery->setBq('[title:PHP]');
  44. $this->assertEquals($this->itemQuery->getBq(), '[title:PHP]');
  45. }
  46. public function testRefine()
  47. {
  48. $this->itemQuery->resetParameters();
  49. $this->itemQuery->setRefine('true');
  50. $this->assertEquals($this->itemQuery->getRefine(), 'true');
  51. }
  52. public function testContent()
  53. {
  54. $this->itemQuery->resetParameters();
  55. $this->itemQuery->setContent('stats');
  56. $this->assertEquals($this->itemQuery->getContent(), 'stats');
  57. }
  58. public function testOrderBy()
  59. {
  60. $this->itemQuery->resetParameters();
  61. $this->itemQuery->setOrderBy('relevancy');
  62. $this->assertEquals($this->itemQuery->getOrderBy(), 'relevancy');
  63. }
  64. public function testSortOrder()
  65. {
  66. $this->itemQuery->resetParameters();
  67. $this->itemQuery->setOrderBy('descending');
  68. $this->assertEquals($this->itemQuery->getOrderBy(), 'descending');
  69. }
  70. public function testCrowdBy()
  71. {
  72. $this->itemQuery->resetParameters();
  73. $this->itemQuery->setCrowdBy('attribute:5,content:2,url');
  74. $this->assertEquals($this->itemQuery->getCrowdBy(), 'attribute:5,content:2,url');
  75. }
  76. public function testAdjust()
  77. {
  78. $this->itemQuery->resetParameters();
  79. $this->itemQuery->setAdjust('true');
  80. $this->assertEquals($this->itemQuery->getAdjust(), 'true');
  81. }
  82. }