PageRenderTime 62ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/zendframework/zendframework/tests/ZendTest/Server/Reflection/ReflectionReturnValueTest.php

https://bitbucket.org/pcelta/zf2
PHP | 109 lines | 37 code | 11 blank | 61 comment | 0 complexity | 284b2a39cf94305f480bdba403ea0907 MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework (http://framework.zend.com/)
  4. *
  5. * @link http://github.com/zendframework/zf2 for the canonical source repository
  6. * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  7. * @license http://framework.zend.com/license/new-bsd New BSD License
  8. * @package Zend_Server
  9. */
  10. namespace ZendTest\Server\Reflection;
  11. use Zend\Server\Reflection;
  12. /**
  13. * Test case for \Zend\Server\Reflection\ReflectionReturnValue
  14. *
  15. * @category Zend
  16. * @package Zend_Server
  17. * @subpackage UnitTests
  18. * @group Zend_Server
  19. */
  20. class ReflectionReturnValueTest extends \PHPUnit_Framework_TestCase
  21. {
  22. /**
  23. * __construct() test
  24. *
  25. * Call as method call
  26. *
  27. * Expects:
  28. * - type: Optional; has default;
  29. * - description: Optional; has default;
  30. *
  31. * Returns: void
  32. */
  33. public function test__construct()
  34. {
  35. $obj = new Reflection\ReflectionReturnValue();
  36. $this->assertTrue($obj instanceof Reflection\ReflectionReturnValue);
  37. }
  38. /**
  39. * getType() test
  40. *
  41. * Call as method call
  42. *
  43. * Returns: string
  44. */
  45. public function testGetType()
  46. {
  47. $obj = new Reflection\ReflectionReturnValue();
  48. $this->assertEquals('mixed', $obj->getType());
  49. $obj->setType('array');
  50. $this->assertEquals('array', $obj->getType());
  51. }
  52. /**
  53. * setType() test
  54. *
  55. * Call as method call
  56. *
  57. * Expects:
  58. * - type:
  59. *
  60. * Returns: void
  61. */
  62. public function testSetType()
  63. {
  64. $obj = new Reflection\ReflectionReturnValue();
  65. $obj->setType('array');
  66. $this->assertEquals('array', $obj->getType());
  67. }
  68. /**
  69. * getDescription() test
  70. *
  71. * Call as method call
  72. *
  73. * Returns: string
  74. */
  75. public function testGetDescription()
  76. {
  77. $obj = new Reflection\ReflectionReturnValue('string', 'Some description');
  78. $this->assertEquals('Some description', $obj->getDescription());
  79. $obj->setDescription('New Description');
  80. $this->assertEquals('New Description', $obj->getDescription());
  81. }
  82. /**
  83. * setDescription() test
  84. *
  85. * Call as method call
  86. *
  87. * Expects:
  88. * - description:
  89. *
  90. * Returns: void
  91. */
  92. public function testSetDescription()
  93. {
  94. $obj = new Reflection\ReflectionReturnValue();
  95. $obj->setDescription('New Description');
  96. $this->assertEquals('New Description', $obj->getDescription());
  97. }
  98. }