Skip to content

Commit 0a9df09

Browse files
1 parent 2f1fc94 commit 0a9df09

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ChangeLog-5.4.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 5.4 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
44

5+
## [5.4.7] - 2016-MM-DD
6+
7+
### Fixed
8+
9+
* Fixed [#2221](https://github.com/sebastianbergmann/phpunit/issues/2221): `expectException()` accepts non-string argument
10+
511
## [5.4.6] - 2016-06-16
612

713
### Fixed
@@ -57,6 +63,7 @@ All notable changes of the PHPUnit 5.4 release series are documented in this fil
5763
* The logfile format generated using the `--log-junit` option and the `<log type="junit" target="..."/>` configuration directive has been updated to match the [current format used by JUnit](http://llg.cubic.org/docs/junit/). Due to this change you may need to update how your continuous integration server processes test result logfiles generated by PHPUnit.
5864
* The usage of test doubles created via data providers has been improved
5965

66+
[5.4.7]: https://github.com/sebastianbergmann/phpunit/compare/5.4.6...5.4.7
6067
[5.4.6]: https://github.com/sebastianbergmann/phpunit/compare/5.4.5...5.4.6
6168
[5.4.5]: https://github.com/sebastianbergmann/phpunit/compare/5.4.4...5.4.5
6269
[5.4.4]: https://github.com/sebastianbergmann/phpunit/compare/5.4.3...5.4.4

src/Framework/TestCase.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
134134
/**
135135
* The name of the expected Exception.
136136
*
137-
* @var mixed
137+
* @var string
138138
*/
139139
private $expectedException = null;
140140

@@ -574,12 +574,16 @@ public function setExpectedExceptionRegExp($exception, $messageRegExp = '', $cod
574574
}
575575

576576
/**
577-
* @param mixed $exception
577+
* @param string $exception
578578
*
579579
* @since Method available since Release 5.2.0
580580
*/
581581
public function expectException($exception)
582582
{
583+
if (!is_string($exception)) {
584+
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
585+
}
586+
583587
$this->expectedException = $exception;
584588
}
585589

0 commit comments

Comments
 (0)