⚝
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
/
Responses
/
View File Name :
PsrResponseFactoryTest.php
<?php namespace League\Glide\Responses; use Mockery; class PsrResponseFactoryTest extends \PHPUnit_Framework_TestCase { public function testCreateInstance() { $response = Mockery::mock('Psr\Http\Message\ResponseInterface'); $streamCallback = function () { }; $this->assertInstanceOf( 'League\Glide\Responses\PsrResponseFactory', new PsrResponseFactory($response, $streamCallback) ); } public function testCreate() { $response = Mockery::mock('Psr\Http\Message\ResponseInterface', function ($mock) { $mock->shouldReceive('withBody')->andReturn($mock)->once(); $mock->shouldReceive('withHeader')->andReturn($mock)->times(4); }); $streamCallback = function ($stream) { return $stream; }; $cache = Mockery::mock('League\Flysystem\FilesystemInterface', function ($mock) { $mock->shouldReceive('getMimetype')->andReturn('image/jpeg'); $mock->shouldReceive('getSize')->andReturn(0); $mock->shouldReceive('readStream')->andReturn( Mockery::mock('Psr\Http\Message\StreamInterface') ); }); $factory = new PsrResponseFactory($response, $streamCallback); $this->assertInstanceOf( 'Psr\Http\Message\ResponseInterface', $factory->create($cache, 'image.jpg') ); } }