Skip to content

Commit 2fb4181

Browse files
author
Lars Moelleken
committed
[+]: update phpunit
1 parent 777f3b6 commit 2fb4181

File tree

4 files changed

+22
-28
lines changed

4 files changed

+22
-28
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ root = true
33

44
[*]
55
indent_style = space
6-
indent_size = 2
6+
indent_size = 4
77
end_of_line = lf
88
charset = utf-8
99
#trim_trailing_whitespace = true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ composer.lock
44

55
# php (phpunit)
66
build/
7+
.phpunit.result.cache
78

89
# php (phpcs fixer)
910
.php_cs.cache

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"ext-dom": "*"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "~6.0 || ~7.0"
26+
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
2727
},
2828
"autoload": {
2929
"psr-4": {

tests/HtmlMinTest.php

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ final class HtmlMinTest extends \PHPUnit\Framework\TestCase
1616

1717
public function testEmptyResult()
1818
{
19-
static::assertSame('', $this->compressor->minify(null));
20-
static::assertSame('', $this->compressor->minify(' '));
21-
static::assertSame('', $this->compressor->minify(''));
19+
static::assertSame('', (new HtmlMin())->minify(null));
20+
static::assertSame('', (new HtmlMin())->minify(' '));
21+
static::assertSame('', (new HtmlMin())->minify(''));
2222
}
2323

2424
/**
@@ -200,45 +200,36 @@ public function providerTrim(): array
200200
],
201201
];
202202
}
203-
204-
protected function setUp()
205-
{
206-
parent::setUp();
207-
$this->compressor = new HtmlMin();
208-
}
209-
210-
protected function tearDown()
211-
{
212-
$this->compressor = null;
213-
}
214-
203+
215204
/**
216205
* @dataProvider providerBoolAttr
217206
*
218207
* @param $input
219208
*/
220209
public function testBoolAttr($input)
221210
{
211+
$minifier = new HtmlMin();
212+
222213
$html = '<!doctype html><html><body><form>' . $input . '</form></body></html>';
223214
$expected = '<!DOCTYPE html><html><body><form><input autofocus checked type=checkbox></form>';
224215

225-
$actual = $this->compressor->minify($html);
216+
$actual = $minifier->minify($html);
226217
static::assertSame($expected, $actual);
227218

228219
// ---
229220

230221
$html = '<html><body><form>' . $input . '</form></body></html>';
231222
$expected = '<html><body><form><input autofocus checked type=checkbox></form>';
232223

233-
$actual = $this->compressor->minify($html);
224+
$actual = $minifier->minify($html);
234225
static::assertSame($expected, $actual);
235226

236227
// ---
237228

238229
$html = '<form>' . $input . '</form>';
239230
$expected = '<form><input autofocus checked type=checkbox></form>';
240231

241-
$actual = $this->compressor->minify($html);
232+
$actual = $minifier->minify($html);
242233
static::assertSame($expected, $actual);
243234
}
244235

@@ -1388,7 +1379,7 @@ public function testForBrokenHtml()
13881379
*/
13891380
public function testMultipleSpaces($input, $expected)
13901381
{
1391-
$actual = $this->compressor->minify($input);
1382+
$actual = (new HtmlMin())->minify($input);
13921383
static::assertSame($expected, $actual);
13931384
}
13941385

@@ -1400,7 +1391,7 @@ public function testMultipleSpaces($input, $expected)
14001391
*/
14011392
public function testNewLinesTabsReturns($input, $expected)
14021393
{
1403-
$actual = $this->compressor->minify($input);
1394+
$actual = (new HtmlMin())->minify($input);
14041395
static::assertSame($expected, $actual);
14051396
}
14061397

@@ -1412,7 +1403,7 @@ public function testNewLinesTabsReturns($input, $expected)
14121403
*/
14131404
public function testSpaceAfterGt($input, $expected)
14141405
{
1415-
$actual = $this->compressor->minify($input);
1406+
$actual = (new HtmlMin())->minify($input);
14161407
static::assertSame($expected, $actual);
14171408
}
14181409

@@ -1424,7 +1415,7 @@ public function testSpaceAfterGt($input, $expected)
14241415
*/
14251416
public function testSpaceBeforeLt($input, $expected)
14261417
{
1427-
$actual = $this->compressor->minify($input);
1418+
$actual = (new HtmlMin())->minify($input);
14281419
static::assertSame($expected, $actual, 'tested: ' . $input);
14291420
}
14301421

@@ -1436,7 +1427,7 @@ public function testSpaceBeforeLt($input, $expected)
14361427
*/
14371428
public function testSpecialCharacterEncoding($input, $expected)
14381429
{
1439-
$actual = $this->compressor->minify($input, true);
1430+
$actual = (new HtmlMin())->minify($input, true);
14401431
static::assertSame($expected, $actual);
14411432
}
14421433

@@ -1448,13 +1439,15 @@ public function testSpecialCharacterEncoding($input, $expected)
14481439
*/
14491440
public function testTrim($input, $expected)
14501441
{
1451-
$actual = $this->compressor->minify($input);
1442+
$actual = (new HtmlMin())->minify($input);
14521443
static::assertSame($expected, $actual);
14531444
}
14541445

14551446
public function testDoRemoveCommentsWithFalse()
14561447
{
1457-
$this->compressor->doRemoveComments(false);
1448+
$minifier = new HtmlMin();
1449+
1450+
$minifier->doRemoveComments(false);
14581451

14591452
$html = <<<'HTML'
14601453
<!DOCTYPE html>
@@ -1473,7 +1466,7 @@ public function testDoRemoveCommentsWithFalse()
14731466

14741467
HTML;
14751468

1476-
$actual = $this->compressor->minify($html);
1469+
$actual = $minifier->minify($html);
14771470

14781471
$expectedHtml = <<<'HTML'
14791472
<!DOCTYPE html><html><head><title>Test</title> <body><!-- do not remove comment --> <hr> <!--

0 commit comments

Comments
 (0)