Permalink
Browse files

This reverts commit b5eb24b.

  • Loading branch information...
1 parent b5eb24b commit 27c729990f566273faebacd766c75f088fa4945e @sebastianbergmann committed Apr 14, 2010
Showing with 10 additions and 11 deletions.
  1. +10 −10 PHPUnit/Framework/Assert.php
  2. +0 −1 README.markdown
@@ -983,21 +983,21 @@ public static function assertAttributeNotSame($expected, $actualAttributeName, $
public static function assertType($expected, $actual, $message = '')
{
if (is_string($expected)) {
- if (class_exists($expected) || interface_exists($expected)) {
- $constraint = new PHPUnit_Framework_Constraint_IsInstanceOf(
+ if (PHPUnit_Util_Type::isType($expected)) {
+ $constraint = new PHPUnit_Framework_Constraint_IsType(
$expected
);
}
- else if (PHPUnit_Util_Type::isType($expected)) {
- $constraint = new PHPUnit_Framework_Constraint_IsType(
+ else if (class_exists($expected) || interface_exists($expected)) {
+ $constraint = new PHPUnit_Framework_Constraint_IsInstanceOf(
$expected
);
}
else {
throw PHPUnit_Util_InvalidArgumentHelper::factory(
- 1, 'class, interface or type name'
+ 1, 'class or interface name'
);
}
} else {
@@ -1036,21 +1036,21 @@ public static function assertAttributeType($expected, $attributeName, $classOrOb
public static function assertNotType($expected, $actual, $message = '')
{
if (is_string($expected)) {
- if (class_exists($expected) || interface_exists($expected)) {
+ if (PHPUnit_Util_Type::isType($expected)) {
$constraint = new PHPUnit_Framework_Constraint_Not(
- new PHPUnit_Framework_Constraint_IsInstanceOf($expected)
+ new PHPUnit_Framework_Constraint_IsType($expected)
);
}
- else if (PHPUnit_Util_Type::isType($expected)) {
+ else if (class_exists($expected) || interface_exists($expected)) {
$constraint = new PHPUnit_Framework_Constraint_Not(
- new PHPUnit_Framework_Constraint_IsType($expected)
+ new PHPUnit_Framework_Constraint_IsInstanceOf($expected)
);
}
else {
throw PHPUnit_Util_InvalidArgumentHelper::factory(
- 1, 'class, interface or type name'
+ 1, 'class or interface name'
);
}
} else {
View
@@ -7,7 +7,6 @@ PHPUnit 3.4.13
--------------
* Fixed TRAC-1035: PostgreSQL MetaData queries are incorrect.
-* Fixed TRAC-1038: `assertType()` and user-defined classes/interfaces.
* The `--repeat` switch is no longer deprecated.
PHPUnit 3.4.12

0 comments on commit 27c7299

Please sign in to comment.