Skip to content

Commit 0e40256

Browse files
authored
More phpunit fixes (#12)
1 parent d1552f2 commit 0e40256

2 files changed

Lines changed: 23 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
5+
## [2.1.5] - 2019-02-04
6+
### Summary
7+
- More tests changes to improve compatibility with PHPUnit 8
8+
59
## [2.1.4] - 2019-02-04
610
### Summary
711
- Changes some tests to improve compatibility with PHPUnit 8

tests/ValidationTestTrait.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,40 @@ abstract protected function getValidation();
2020
public function testGetRequiredInputs()
2121
{
2222
$inputs = $this->getValidation()->getRequiredInputs();
23-
$this->assertInternalType('array',
23+
$this->assertIsArray(
2424
$inputs,
25-
'getRequiredInputs did not return an array');
25+
'getRequiredInputs did not return an array'
26+
);
2627
foreach ($inputs as $key => $type) {
27-
$this->assertInternalType('string',
28+
$this->assertIsString(
2829
$key,
29-
'getRequiredInputs contains an invalid key');
30-
$this->assertInstanceOf('Firehed\Input\Objects\InputObject',
30+
'getRequiredInputs contains an invalid key'
31+
);
32+
$this->assertInstanceOf(Objects\InputObject::class,
3133
$type,
32-
"getRequiredInputs[$key] is not an InputObject");
34+
"getRequiredInputs[$key] is not an InputObject"
35+
);
3336
}
3437
}
3538

3639
/** @covers ::getOptionalInputs */
3740
public function testGetOptionalInputs()
3841
{
3942
$inputs = $this->getValidation()->getOptionalInputs();
40-
$this->assertInternalType('array',
43+
$this->assertIsArray(
4144
$inputs,
42-
'getOptionalInputs did not return an array');
45+
'getOptionalInputs did not return an array'
46+
);
4347
foreach ($inputs as $key => $type) {
44-
$this->assertInternalType('string',
48+
$this->assertIsString(
4549
$key,
46-
'getOptionalInputs contains an invalid key');
47-
$this->assertInstanceOf('Firehed\Input\Objects\InputObject',
50+
'getOptionalInputs contains an invalid key'
51+
);
52+
$this->assertInstanceOf(
53+
Objects\InputObject::class,
4854
$type,
49-
"getOptionalInputs[$key] is not an InputObject");
55+
"getOptionalInputs[$key] is not an InputObject"
56+
);
5057
}
5158
}
5259

0 commit comments

Comments
 (0)