UtilTest.php 671 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of the php-code-coverage package.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace SebastianBergmann\CodeCoverage;
  11. /**
  12. * @covers SebastianBergmann\CodeCoverage\Util
  13. */
  14. class UtilTest extends \PHPUnit_Framework_TestCase
  15. {
  16. public function testPercent()
  17. {
  18. $this->assertEquals(100, Util::percent(100, 0));
  19. $this->assertEquals(100, Util::percent(100, 100));
  20. $this->assertEquals(
  21. '100.00%',
  22. Util::percent(100, 100, true)
  23. );
  24. }
  25. }