ResultTest.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_Service_Technorati
  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. /**
  23. * Test helper
  24. */
  25. require_once dirname(__FILE__) . DIRECTORY_SEPARATOR .'TestCase.php';
  26. /**
  27. * @see Zend_Service_Technorati_Result
  28. */
  29. require_once 'Zend/Service/Technorati/Result.php';
  30. /**
  31. * @see Zend_Service_Technorati_SearchResult
  32. */
  33. require_once 'Zend/Service/Technorati/SearchResult.php';
  34. /**
  35. * @category Zend
  36. * @package Zend_Service_Technorati
  37. * @subpackage UnitTests
  38. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  39. * @license http://framework.zend.com/license/new-bsd New BSD License
  40. * @group Zend_Service
  41. * @group Zend_Service_Technorati
  42. */
  43. class Zend_Service_Technorati_ResultTest extends Zend_Service_Technorati_TestCase
  44. {
  45. /**
  46. * Any *Result class should be a child of Result
  47. * thus it's safe to test basic methods on such child class.
  48. */
  49. public function setUp()
  50. {
  51. $this->ref = new ReflectionClass('Zend_Service_Technorati_Result');
  52. $this->domElements = self::getTestFileElementsAsDom('TestSearchResultSet.xml');
  53. $this->object = new Zend_Service_Technorati_SearchResult($this->domElements->item(0));
  54. $this->objectRef = new ReflectionObject($this->object);
  55. }
  56. public function testResultIsAbstract()
  57. {
  58. $this->assertTrue($this->ref->isAbstract());
  59. }
  60. /**
  61. * Security check
  62. */
  63. public function testResultIsParentOfThisObjectClass()
  64. {
  65. $this->assertTrue($this->objectRef->isSubclassOf($this->ref));
  66. }
  67. public function testResultSerialization()
  68. {
  69. $this->_testResultSerialization($this->object);
  70. }
  71. }