ResultTest.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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-2008 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-2008 Zend Technologies USA Inc. (http://www.zend.com)
  39. * @license http://framework.zend.com/license/new-bsd New BSD License
  40. */
  41. class Zend_Service_Technorati_ResultTest extends Zend_Service_Technorati_TestCase
  42. {
  43. /**
  44. * Any *Result class should be a child of Result
  45. * thus it's safe to test basic methods on such child class.
  46. */
  47. public function setUp()
  48. {
  49. $this->ref = new ReflectionClass('Zend_Service_Technorati_Result');
  50. $this->domElements = self::getTestFileElementsAsDom('TestSearchResultSet.xml');
  51. $this->object = new Zend_Service_Technorati_SearchResult($this->domElements->item(0));
  52. $this->objectRef = new ReflectionObject($this->object);
  53. }
  54. public function testResultIsAbstract()
  55. {
  56. $this->assertTrue($this->ref->isAbstract());
  57. }
  58. /**
  59. * Security check
  60. */
  61. public function testResultIsParentOfThisObjectClass()
  62. {
  63. $this->assertTrue($this->objectRef->isSubclassOf($this->ref));
  64. }
  65. public function testResultSerialization()
  66. {
  67. $this->_testResultSerialization($this->object);
  68. }
  69. }