Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit b8c0c33

Browse files
committed
class_alias not present in PHP 5.2; down to subclassing
1 parent 25a5e24 commit b8c0c33

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

library/Zend/Test/PHPUnit/Constraint/DomQuery.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222

2323
if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) {
2424
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery41.php');
25-
$alias = 'Zend_Test_PHPUnit_Constraint_DomQuery41';
25+
26+
class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery41
27+
{}
2628
} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) {
2729
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery37.php');
28-
$alias = 'Zend_Test_PHPUnit_Constraint_DomQuery37';
30+
31+
class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery37
32+
{}
2933
} else {
3034
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery34.php');
31-
$alias = 'Zend_Test_PHPUnit_Constraint_DomQuery34';
32-
}
3335

34-
class_alias(
35-
$alias,
36-
'Zend_Test_PHPUnit_Constraint_DomQuery'
37-
);
36+
class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery34
37+
{}
38+
}

library/Zend/Test/PHPUnit/Constraint/Redirect.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222

2323
if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) {
2424
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect41.php');
25-
$alias = 'Zend_Test_PHPUnit_Constraint_Redirect41';
25+
26+
class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect41
27+
{}
2628
} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) {
2729
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect37.php');
28-
$alias = 'Zend_Test_PHPUnit_Constraint_Redirect37';
30+
31+
class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect37
32+
{}
2933
} else {
3034
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect34.php');
31-
$alias = 'Zend_Test_PHPUnit_Constraint_Redirect34';
32-
}
3335

34-
class_alias(
35-
$alias,
36-
'Zend_Test_PHPUnit_Constraint_Redirect'
37-
);
36+
class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect34
37+
{}
38+
}

library/Zend/Test/PHPUnit/Constraint/ResponseHeader.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222

2323
if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) {
2424
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader41.php');
25-
$alias = 'Zend_Test_PHPUnit_Constraint_ResponseHeader41';
25+
26+
class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader41
27+
{}
2628
} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) {
2729
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader37.php');
28-
$alias = 'Zend_Test_PHPUnit_Constraint_ResponseHeader37';
30+
31+
class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader37
32+
{}
2933
} else {
3034
include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader34.php');
31-
$alias = 'Zend_Test_PHPUnit_Constraint_ResponseHeader34';
32-
}
3335

34-
class_alias(
35-
$alias,
36-
'Zend_Test_PHPUnit_Constraint_ResponseHeader'
37-
);
36+
class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader34
37+
{}
38+
}

0 commit comments

Comments
 (0)