PageRenderTime 36ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/Zend/Server/Reflection/ReturnValueTest.php

https://bitbucket.org/dbaltas/zend-framework-1.x-on-git
PHP | 121 lines | 36 code | 10 blank | 75 comment | 0 complexity | 76b731071400ad00baa647bc842079c6 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, MIT
  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_Server
  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: ReturnValueTest.php 24593 2012-01-05 20:35:02Z matthew $
  21. */
  22. require_once 'Zend/Server/Reflection/ReturnValue.php';
  23. /**
  24. * Test case for Zend_Server_Reflection_ReturnValue
  25. *
  26. * @category Zend
  27. * @package Zend_Server
  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_Server
  32. */
  33. class Zend_Server_Reflection_ReturnValueTest extends PHPUnit_Framework_TestCase
  34. {
  35. /**
  36. * __construct() test
  37. *
  38. * Call as method call
  39. *
  40. * Expects:
  41. * - type: Optional; has default;
  42. * - description: Optional; has default;
  43. *
  44. * Returns: void
  45. */
  46. public function test__construct()
  47. {
  48. $obj = new Zend_Server_Reflection_ReturnValue();
  49. $this->assertTrue($obj instanceof Zend_Server_Reflection_ReturnValue);
  50. }
  51. /**
  52. * getType() test
  53. *
  54. * Call as method call
  55. *
  56. * Returns: string
  57. */
  58. public function testGetType()
  59. {
  60. $obj = new Zend_Server_Reflection_ReturnValue();
  61. $this->assertEquals('mixed', $obj->getType());
  62. $obj->setType('array');
  63. $this->assertEquals('array', $obj->getType());
  64. }
  65. /**
  66. * setType() test
  67. *
  68. * Call as method call
  69. *
  70. * Expects:
  71. * - type:
  72. *
  73. * Returns: void
  74. */
  75. public function testSetType()
  76. {
  77. $obj = new Zend_Server_Reflection_ReturnValue();
  78. $obj->setType('array');
  79. $this->assertEquals('array', $obj->getType());
  80. }
  81. /**
  82. * getDescription() test
  83. *
  84. * Call as method call
  85. *
  86. * Returns: string
  87. */
  88. public function testGetDescription()
  89. {
  90. $obj = new Zend_Server_Reflection_ReturnValue('string', 'Some description');
  91. $this->assertEquals('Some description', $obj->getDescription());
  92. $obj->setDescription('New Description');
  93. $this->assertEquals('New Description', $obj->getDescription());
  94. }
  95. /**
  96. * setDescription() test
  97. *
  98. * Call as method call
  99. *
  100. * Expects:
  101. * - description:
  102. *
  103. * Returns: void
  104. */
  105. public function testSetDescription()
  106. {
  107. $obj = new Zend_Server_Reflection_ReturnValue();
  108. $obj->setDescription('New Description');
  109. $this->assertEquals('New Description', $obj->getDescription());
  110. }
  111. }