forked from laravel/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpTestingFileFactoryTest.php
More file actions
39 lines (29 loc) · 1.11 KB
/
HttpTestingFileFactoryTest.php
File metadata and controls
39 lines (29 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Illuminate\Tests\Http;
use Illuminate\Http\Testing\FileFactory;
use PHPUnit\Framework\TestCase;
class HttpTestingFileFactoryTest extends TestCase
{
public function testImagePng()
{
if (! function_exists('imagepng')) {
$this->markTestSkipped('The extension gd is missing from your system or was compiled without PNG support.');
}
$image = (new FileFactory)->image('test.png', 15, 20);
$info = getimagesize($image->getRealPath());
$this->assertSame('image/png', $info['mime']);
$this->assertSame(15, $info[0]);
$this->assertSame(20, $info[1]);
}
public function testImageJpeg()
{
if (! function_exists('imagejpeg')) {
$this->markTestSkipped('The extension gd is missing from your system or was compiled without JPEG support.');
}
$image = (new FileFactory)->image('test.jpeg', 15, 20);
$info = getimagesize($image->getRealPath());
$this->assertSame('image/jpeg', $info['mime']);
$this->assertSame(15, $info[0]);
$this->assertSame(20, $info[1]);
}
}