This repository has been archived by the owner. It is now read-only.

Zend_Test works with both PHPUnit 3.4 and 3.7+ #214

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@mhujer
Copy link
Contributor

mhujer commented Oct 17, 2013

I know, it is a little bit hacky solution, but it makes it possible to use controller tests in PHPUnit 3.4 as well as any higher version.
I suppose, that ZF1 is in some maintance mode, where the main goal is to have it running on newer SW versions and if someone wants to have superclean code, he can use ZF2 ;)

Inpired by the patch from http://opensource.hqcodeshop.com/Zend%20Framework/PHPUnit%203.7%20-%201.12.1/

@weierophinney

This comment has been minimized.

Copy link
Member

weierophinney commented Oct 23, 2013

This looks great!

However...

A couple additional things need to happen. First, tests/TestHelper.php has to be altered to remove the echo/exit in the first conditional. Second, a lot of tests still do not run. When I tried to run Zend/Test/PHPUnit/Alltests.php, I got a number of errors due to inability to load files (in particular, PHPUnit/Extensions/Database/* files).

If we can get all these issues sorted, I'll gladly merge!

Zend_Test works with both PHPUnit 3.4 and 3.7+
I know, it is a little bit hacky solution, but it makes it possible to use controller tests in PHPUnit 3.4 as well as any higher version.
I suppose, that ZF1 is in some maintance mode, where the main goal is to have it running on newer SW versions and if someone wants to have superclean code, he can use ZF2 ;)

Inpired by the patch from http://opensource.hqcodeshop.com/Zend%20Framework/PHPUnit%203.7%20-%201.12.1/
@mhujer

This comment has been minimized.

Copy link
Contributor

mhujer commented Oct 24, 2013

This PR was focused just on making it possible to use Zend_Test_* classes in projects which use newer PHPUnit for their testing.

ZF1 itself still needs to be tested in PHPUnit 3.4, as there are many occurences of assertType() which was later changed to assertInstanceOf(). It can be rewritten to assertTrue(... instanceof ...) to be compatible with both PHPUnit versions (we can't bump ZF1 requirements to PHPUnit 3.7, right?)
Do you think it is worth rewriting it? (it can probably be done by some regular expression).

PHPUnit/Extensions/Database/* errors might have been caused by missing DbUnit package?

@weierophinney

This comment has been minimized.

Copy link
Member

weierophinney commented Oct 24, 2013

@mhujer You're absolutely right -- I saw Zend_Test and immediately assumed these were fixes to the test suite themselves, not the component. Merging.

@ghost ghost assigned weierophinney Oct 24, 2013

weierophinney added a commit that referenced this pull request Oct 24, 2013

Merge pull request #214 from mhujer/phpunit-multicompatibility
Zend_Test works with both PHPUnit 3.4 and 3.7+

@mhujer mhujer deleted the mhujer:phpunit-multicompatibility branch Apr 9, 2014

xopherdeep pushed a commit to xopherdeep/Zend-Framework-v1 that referenced this pull request Jul 3, 2014

Merge pull request zendframework#214 from mhujer/phpunit-multicompati…
…bility

Zend_Test works with both PHPUnit 3.4 and 3.7+

xopherdeep pushed a commit to xopherdeep/Zend-Framework-v1 that referenced this pull request Jul 3, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.