Skip to content

Commit f13e90c

Browse files
authored
Upgrade to phpunit 8.5 which supports php 7.2 through 8.0 (#49)
The library is still limited to PHP ^7.2 - this change is a prereq for full PHP8 compatibility which will come in the next PR.
1 parent 7d8d967 commit f13e90c

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
# - windows-latest # Disabled - apparently checkouts have \r\n which breaks phpcs
1313
- macos-latest
1414
php-versions:
15-
- '7.1'
1615
- '7.2'
1716
- '7.3'
1817
- '7.4'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build/
33
phpunit.xml
44
.idea/
55
composer.lock
6+
.phpunit.result.cache

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^7.1",
15+
"php": "^7.2",
1616
"symfony/polyfill-mbstring": ">=1.3.1"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^7.0",
19+
"phpunit/phpunit": "^8.5",
2020
"php-coveralls/php-coveralls": "*",
2121
"squizlabs/php_codesniffer": "3.*"
2222
},

test/FeedbackTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class FeedbackTest extends TestCase
1313
/** @var Feedback */
1414
private $feedback;
1515

16-
public function setUp()
16+
public function setUp(): void
1717
{
1818
$this->feedback = new Feedback();
1919
}
@@ -48,9 +48,9 @@ public function testLongestMatchGetsFeedback()
4848
{
4949
$match1 = new SequenceMatch('abcd26-01-1991', 0, 4, 'abcd');
5050
$match2 = new DateMatch('abcd26-01-1991', 4, 14, '26-01-1991', [
51-
'day' => 26,
52-
'month' => 1,
53-
'year' => 1991,
51+
'day' => 26,
52+
'month' => 1,
53+
'year' => 1991,
5454
'separator' => '-',
5555
]);
5656
$feedback = $this->feedback->getFeedback(1, [$match1, $match2]);
@@ -75,9 +75,9 @@ public function testLongestMatchGetsFeedback()
7575
public function testDefaultSuggestion()
7676
{
7777
$match = new DateMatch('26-01-1991', 0, 10, '26-01-1991', [
78-
'day' => 26,
79-
'month' => 1,
80-
'year' => 1991,
78+
'day' => 26,
79+
'month' => 1,
80+
'year' => 1991,
8181
'separator' => '-',
8282
]);
8383
$feedback = $this->feedback->getFeedback(1, [$match]);

test/ScorerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ class ScorerTest extends TestCase
1616
/** @var Scorer */
1717
private $scorer;
1818

19-
public function setUp()
19+
public function setUp(): void
2020
{
2121
$this->scorer = new Scorer();
2222
}
23+
2324
public function testBlankPassword()
2425
{
2526
$result = $this->scorer->getMostGuessableMatchSequence('', []);

test/TimeEstimatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TimeEstimatorTest extends TestCase
1010
/** @var TimeEstimator */
1111
private $timeEstimator;
1212

13-
public function setUp()
13+
public function setUp(): void
1414
{
1515
$this->timeEstimator = new TimeEstimator();
1616
}

test/ZxcvbnTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ZxcvbnTest extends TestCase
1313
/** @var Zxcvbn */
1414
private $zxcvbn;
1515

16-
public function setUp()
16+
public function setUp(): void
1717
{
1818
$this->zxcvbn = new Zxcvbn();
1919
}
@@ -39,7 +39,7 @@ public function typeDataProvider()
3939
['crack_times_seconds', 'array'],
4040
['crack_times_display', 'array'],
4141
['feedback', 'array'],
42-
['calc_time', 'numeric']
42+
['calc_time', 'numeric'],
4343
];
4444
}
4545

@@ -87,11 +87,11 @@ public function sanityCheckDataProvider()
8787
* Some basic sanity checks. All of the underlying functionality is tested in more details in their specific
8888
* classes, but this is just to check that it's all tied together correctly at the end.
8989
* @dataProvider sanityCheckDataProvider
90-
* @param string $password
91-
* @param int $score
90+
* @param string $password
91+
* @param int $score
9292
* @param string[] $patterns
93-
* @param string $slowHashingDisplay
94-
* @param float $guesses
93+
* @param string $slowHashingDisplay
94+
* @param float $guesses
9595
*/
9696
public function testZxcvbnSanityCheck($password, $score, $patterns, $slowHashingDisplay, $guesses)
9797
{

0 commit comments

Comments
 (0)