Mixed.php 919 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * TLDSupport: Support package for TLDDatabase and TLDExtract.
  4. *
  5. * @link https://github.com/layershifter/TLDSupport
  6. *
  7. * @copyright Copyright (c) 2016, Alexander Fedyashov
  8. * @license https://raw.githubusercontent.com/layershifter/TLDSupport/master/LICENSE Apache 2.0 License
  9. */
  10. namespace LayerShifter\TLDSupport\Tests\Helpers;
  11. use LayerShifter\TLDSupport\Helpers\Mixed;
  12. /**
  13. * Test cases for Helpers\Mixed class.
  14. */
  15. class MixedTest extends \PHPUnit_Framework_TestCase
  16. {
  17. /**
  18. * Test for value() method.
  19. *
  20. * @return void
  21. */
  22. public function testValue()
  23. {
  24. self::assertEquals(1, Mixed::value(1));
  25. self::assertInternalType('int', Mixed::value(1));
  26. self::assertEquals(2, Mixed::value(function () {
  27. return 2;
  28. }));
  29. self::assertInternalType('int', Mixed::value(function () {
  30. return 2;
  31. }));
  32. }
  33. }