UtilTest.php (804B)
1 <?php 2 /* 3 * This file is part of the PHP_CodeCoverage 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 11 /** 12 * Tests for the PHP_CodeCoverage_Util class. 13 * 14 * @since Class available since Release 1.0.0 15 */ 16 class PHP_CodeCoverage_UtilTest extends PHPUnit_Framework_TestCase 17 { 18 /** 19 * @covers PHP_CodeCoverage_Util::percent 20 */ 21 public function testPercent() 22 { 23 $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 0)); 24 $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 100)); 25 $this->assertEquals( 26 '100.00%', 27 PHP_CodeCoverage_Util::percent(100, 100, true) 28 ); 29 } 30 }