Skip to content

Commit

Permalink
More phpunit fixes (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Feb 4, 2019
1 parent d1552f2 commit 0e40256
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [2.1.5] - 2019-02-04
### Summary
- More tests changes to improve compatibility with PHPUnit 8

## [2.1.4] - 2019-02-04
### Summary
- Changes some tests to improve compatibility with PHPUnit 8
Expand Down
31 changes: 19 additions & 12 deletions tests/ValidationTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,40 @@ abstract protected function getValidation();
public function testGetRequiredInputs()
{
$inputs = $this->getValidation()->getRequiredInputs();
$this->assertInternalType('array',
$this->assertIsArray(
$inputs,
'getRequiredInputs did not return an array');
'getRequiredInputs did not return an array'
);
foreach ($inputs as $key => $type) {
$this->assertInternalType('string',
$this->assertIsString(
$key,
'getRequiredInputs contains an invalid key');
$this->assertInstanceOf('Firehed\Input\Objects\InputObject',
'getRequiredInputs contains an invalid key'
);
$this->assertInstanceOf(Objects\InputObject::class,
$type,
"getRequiredInputs[$key] is not an InputObject");
"getRequiredInputs[$key] is not an InputObject"
);
}
}

/** @covers ::getOptionalInputs */
public function testGetOptionalInputs()
{
$inputs = $this->getValidation()->getOptionalInputs();
$this->assertInternalType('array',
$this->assertIsArray(
$inputs,
'getOptionalInputs did not return an array');
'getOptionalInputs did not return an array'
);
foreach ($inputs as $key => $type) {
$this->assertInternalType('string',
$this->assertIsString(
$key,
'getOptionalInputs contains an invalid key');
$this->assertInstanceOf('Firehed\Input\Objects\InputObject',
'getOptionalInputs contains an invalid key'
);
$this->assertInstanceOf(
Objects\InputObject::class,
$type,
"getOptionalInputs[$key] is not an InputObject");
"getOptionalInputs[$key] is not an InputObject"
);
}
}

Expand Down

0 comments on commit 0e40256

Please sign in to comment.