Skip to content

Commit a07476f

Browse files
committed
test cases updated for new phpunit
1 parent 83ed1bc commit a07476f

File tree

3 files changed

+15
-22
lines changed

3 files changed

+15
-22
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If using [Composer](https://getcomposer.org/), in your `composer.json` file add:
2222
```json
2323
{
2424
"require": {
25-
"gumlet/php-image-resize": "1.9.*"
25+
"gumlet/php-image-resize": "2.0.*"
2626
}
2727
}
2828
```
@@ -31,6 +31,8 @@ If you are still using PHP 5.3, please install version ```1.7.0``` and if you ar
3131

3232
WebP support is added with PHP `5.6.0` and current version of library supports that. If you are facing issues, please use `1.9.2` version of this library.
3333

34+
For PHP versions >= 7.2, `2.0.1` or above version of this library should be used.
35+
3436
Otherwise:
3537

3638
```php

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}],
1313
"require":
1414
{
15-
"php": ">=5.5.0",
15+
"php": ">=5.6.0",
1616
"ext-gd": "*",
1717
"ext-fileinfo": "*"
1818
},

test/ImageResizeTest.php

+11-20
Original file line numberDiff line numberDiff line change
@@ -106,39 +106,32 @@ public function testApplyFilter()
106106
* Bad load tests
107107
*/
108108

109-
/**
110-
* @expectedException \Gumlet\ImageResizeException
111-
* @expectedExceptionMessage File does not exist
112-
*/
113109
public function testLoadNoFile()
114110
{
111+
$this->expectException(ImageResizeException::class);
112+
$this->expectExceptionMessage('File does not exist');
115113
new ImageResize(null);
116114
}
117115

118-
/**
119-
* @expectedException \Gumlet\ImageResizeException
120-
* @expectedExceptionMessage Unsupported file type
121-
*/
122116
public function testLoadUnsupportedFile()
123117
{
118+
$this->expectException(ImageResizeException::class);
119+
$this->expectExceptionMessage('Unsupported file type');
124120
new ImageResize(__FILE__);
125121
}
126122

127-
/**
128-
* @expectedException \Gumlet\ImageResizeException
129-
* @expectedExceptionMessage image_data must not be empty
130-
*/
131123
public function testLoadUnsupportedFileString()
132124
{
125+
$this->expectException(ImageResizeException::class);
126+
$this->expectExceptionMessage('image_data must not be empty');
133127
ImageResize::createFromString('');
134128
}
135129

136-
/**
137-
* @expectedException \Gumlet\ImageResizeException
138-
* @expectedExceptionMessage Unsupported image type
139-
*/
130+
140131
public function testLoadUnsupportedImage()
141132
{
133+
$this->expectException(ImageResizeException::class);
134+
$this->expectExceptionMessage('Unsupported image type');
142135
$filename = $this->getTempFile();
143136

144137
$image = fopen($filename, 'w');
@@ -148,12 +141,10 @@ public function testLoadUnsupportedImage()
148141
new ImageResize($filename);
149142
}
150143

151-
/**
152-
* @expectedException \Gumlet\ImageResizeException
153-
* @expectedExceptionMessage Unsupported image type
154-
*/
155144
public function testInvalidString()
156145
{
146+
$this->expectException(ImageResizeException::class);
147+
$this->expectExceptionMessage('Unsupported image type');
157148
ImageResize::createFromString(base64_decode($this->unsupported_image));
158149
}
159150

0 commit comments

Comments
 (0)