%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11585/cwd/html/ppaobm/vendor/phpunit/php-code-coverage/tests/tests/ |
Upload File : |
<?php /* * This file is part of the php-code-coverage package. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SebastianBergmann\CodeCoverage\Report\Html; use SebastianBergmann\CodeCoverage\TestCase; class HTMLTest extends TestCase { private static $TEST_REPORT_PATH_SOURCE; public static function setUpBeforeClass() { parent::setUpBeforeClass(); self::$TEST_REPORT_PATH_SOURCE = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML'; } protected function tearDown() { parent::tearDown(); $tmpFilesIterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator(self::$TEST_TMP_PATH, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST ); foreach ($tmpFilesIterator as $path => $fileInfo) { /* @var \SplFileInfo $fileInfo */ $pathname = $fileInfo->getPathname(); $fileInfo->isDir() ? rmdir($pathname) : unlink($pathname); } } public function testForBankAccountTest() { $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForBankAccount'; $report = new Facade; $report->process($this->getCoverageForBankAccount(), self::$TEST_TMP_PATH); $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); } public function testForFileWithIgnoredLines() { $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines'; $report = new Facade; $report->process($this->getCoverageForFileWithIgnoredLines(), self::$TEST_TMP_PATH); $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); } public function testForClassWithAnonymousFunction() { $expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction'; $report = new Facade; $report->process($this->getCoverageForClassWithAnonymousFunction(), self::$TEST_TMP_PATH); $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); } /** * @param string $expectedFilesPath * @param string $actualFilesPath */ private function assertFilesEquals($expectedFilesPath, $actualFilesPath) { $expectedFilesIterator = new \FilesystemIterator($expectedFilesPath); $actualFilesIterator = new \RegexIterator(new \FilesystemIterator($actualFilesPath), '/.html/'); $this->assertEquals( iterator_count($expectedFilesIterator), iterator_count($actualFilesIterator), 'Generated files and expected files not match' ); foreach ($expectedFilesIterator as $path => $fileInfo) { /* @var \SplFileInfo $fileInfo */ $filename = $fileInfo->getFilename(); $actualFile = $actualFilesPath . DIRECTORY_SEPARATOR . $filename; $this->assertFileExists($actualFile); $this->assertStringMatchesFormatFile( $fileInfo->getPathname(), str_replace(PHP_EOL, "\n", file_get_contents($actualFile)), "${filename} not match" ); } } }