ZF 2.0 Status: 10 Mar 2010

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ZF 2.0 Status: 10 Mar 2010

weierophinney
Administrator
Greetings!

Since the last update, myself and the team have been busy working on the
test suite. We had the following goals:

 * Strip (most) require_once calls
   If we're going to be an autoloading framework, unit tests should use
   autoloading as well.
 
 * Remove all AllTests.php files
   These are largely a relic of the early days of ZF development, and
   are not really needed anymore. You can specify specific directories
   in which to run tests, individual files, by group, and more;
   additionally, there are better tools for building test suites.

 * Create a phpunit.xml and test bootstrap
   This will allow us to specify rules for running tests, as well as the
   actual test environment for every test case.

 * Have all tests passing (or at least in the same state as trunk)

Ralph is working on Zend_Tool tests as I write this -- but that's the
last component to be reviewed. Otherwise, all the tasks above are now
accomplished. To run any tests, you simply change directory to the
tests/ subdirectory, and then call phpunit with any arguments you want
to specify (including directories or files).

Additionally, we've made some changes to Zend_Loader_Autoloader. Since
ZF users will likely be using both code with true PHP namespaces as well
as code using simply pre-5.3 style vendor prefixes, we introduced a set
of "registerPrefix" methods. The old familiar "registerNamespace"
methods will now work only for classes using PHP namespace notation.
This is definitely a BC break, but one that should be fairly trivial to
script a fix for in existing codebases.

Next on our list of "foundational tasks" to tackle:

 * Conversion to namespaces
 * Refactoring of exceptions

These tasks will likely take longer than what we've done to date. We are
aiming to balance automatic conversion, code readability, and
performance -- and I'm not expecting a good solution to present itself
on our first few tries.

Until next time, happy programming!

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Reply | Threaded
Open this post in threaded view
|

Re: ZF 2.0 Status: 10 Mar 2010

A.J. Brown-3
Hey Matthew,

Glad to see things moving along with ZF 2.0!

I'm not sure about the requirement for autoloading in _unit_ tests.  Autoloading adds another layer of code that's not directly related to the unit under test.  A bug in AutoLoading could directly affect the outcome of another unit test.  Imagine a situation where the wrong class is autoloaded in the middle of a test, but it just so happens to work out. 

Of course, autoloading should be incorporated in more comprehensive tests.

Thoughts?


On Wed, Mar 10, 2010 at 4:48 PM, Matthew Weier O'Phinney <[hidden email]> wrote:
Greetings!

Since the last update, myself and the team have been busy working on the
test suite. We had the following goals:

 * Strip (most) require_once calls
  If we're going to be an autoloading framework, unit tests should use
  autoloading as well.

 * Remove all AllTests.php files
  These are largely a relic of the early days of ZF development, and
  are not really needed anymore. You can specify specific directories
  in which to run tests, individual files, by group, and more;
  additionally, there are better tools for building test suites.

 * Create a phpunit.xml and test bootstrap
  This will allow us to specify rules for running tests, as well as the
  actual test environment for every test case.

 * Have all tests passing (or at least in the same state as trunk)

Ralph is working on Zend_Tool tests as I write this -- but that's the
last component to be reviewed. Otherwise, all the tasks above are now
accomplished. To run any tests, you simply change directory to the
tests/ subdirectory, and then call phpunit with any arguments you want
to specify (including directories or files).

Additionally, we've made some changes to Zend_Loader_Autoloader. Since
ZF users will likely be using both code with true PHP namespaces as well
as code using simply pre-5.3 style vendor prefixes, we introduced a set
of "registerPrefix" methods. The old familiar "registerNamespace"
methods will now work only for classes using PHP namespace notation.
This is definitely a BC break, but one that should be fairly trivial to
script a fix for in existing codebases.

Next on our list of "foundational tasks" to tackle:

 * Conversion to namespaces
 * Refactoring of exceptions

These tasks will likely take longer than what we've done to date. We are
aiming to balance automatic conversion, code readability, and
performance -- and I'm not expecting a good solution to present itself
on our first few tries.

Until next time, happy programming!

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc



--
A.J. Brown
Software Engineer, ZCE
blog : http://ajbrown.org
talk  : (937) 540-0099
chat : IntypicaAJ
Reply | Threaded
Open this post in threaded view
|

Re: ZF 2.0 Status: 10 Mar 2010

hobodave
On Mar 12, 2010, at 4:37 PM, A.J. Brown wrote:

I'm not sure about the requirement for autoloading in _unit_ tests.  Autoloading adds another layer of code that's not directly related to the unit under test.  A bug in AutoLoading could directly affect the outcome of another unit test.  Imagine a situation where the wrong class is autoloaded in the middle of a test, but it just so happens to work out.  

This is a good point. I think it's important to be able to look at a unit test and see exactly what's going on instead of relying on what the framework to take care of it (you hope).

--
David Abdemoulaie
Reply | Threaded
Open this post in threaded view
|

Re: ZF 2.0 Status: 10 Mar 2010

Ben Scholzen 'DASPRiD'
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ZF 2.0 Status: 10 Mar 2010

weierophinney
Administrator
In reply to this post by A.J. Brown-3
-- A.J. Brown <[hidden email]> wrote
(on Friday, 12 March 2010, 05:37 PM -0500):

> Glad to see things moving along with ZF 2.0!
>
> I'm not sure about the requirement for autoloading in _unit_ tests.
> Autoloading adds another layer of code that's not directly related to the unit
> under test.  A bug in AutoLoading could directly affect the outcome of another
> unit test.  Imagine a situation where the wrong class is autoloaded in the
> middle of a test, but it just so happens to work out.
>
> Of course, autoloading should be incorporated in more comprehensive tests.
>
> Thoughts?

The autoloading is regarding autoloading of the ZF components within the
tests themselves. Since the autoloader is already tested, this simply
works; if we start seeing issues within the testbed, then we have new
test cases to add to the autoloader.

Additionally, if we don't do autoloading, then the test cases become
more difficult, as the library is designed for autoloading. Since the
class files themselves do not have require_once statements in them, we
would have to go and create the entire list of equivalent require_once
statements necessary to load all dependencies -- which would also
introduce potential issues, and a ton of overhead for those testing the
systems.

We already have autoloading working perfectly with the test suite, by
the way (you can verify this by checking out the development-2.0
branch); I see no reason to change this.

> On Wed, Mar 10, 2010 at 4:48 PM, Matthew Weier O'Phinney <[hidden email]>
> wrote:
>
>     Greetings!
>
>     Since the last update, myself and the team have been busy working on the
>     test suite. We had the following goals:
>
>      * Strip (most) require_once calls
>       If we're going to be an autoloading framework, unit tests should use
>       autoloading as well.
>
>      * Remove all AllTests.php files
>       These are largely a relic of the early days of ZF development, and
>       are not really needed anymore. You can specify specific directories
>       in which to run tests, individual files, by group, and more;
>       additionally, there are better tools for building test suites.
>
>      * Create a phpunit.xml and test bootstrap
>       This will allow us to specify rules for running tests, as well as the
>       actual test environment for every test case.
>
>      * Have all tests passing (or at least in the same state as trunk)
>
>     Ralph is working on Zend_Tool tests as I write this -- but that's the
>     last component to be reviewed. Otherwise, all the tasks above are now
>     accomplished. To run any tests, you simply change directory to the
>     tests/ subdirectory, and then call phpunit with any arguments you want
>     to specify (including directories or files).
>
>     Additionally, we've made some changes to Zend_Loader_Autoloader. Since
>     ZF users will likely be using both code with true PHP namespaces as well
>     as code using simply pre-5.3 style vendor prefixes, we introduced a set
>     of "registerPrefix" methods. The old familiar "registerNamespace"
>     methods will now work only for classes using PHP namespace notation.
>     This is definitely a BC break, but one that should be fairly trivial to
>     script a fix for in existing codebases.
>
>     Next on our list of "foundational tasks" to tackle:
>
>      * Conversion to namespaces
>      * Refactoring of exceptions
>
>     These tasks will likely take longer than what we've done to date. We are
>     aiming to balance automatic conversion, code readability, and
>     performance -- and I'm not expecting a good solution to present itself
>     on our first few tries.
>
>     Until next time, happy programming!
>
>     --
>     Matthew Weier O'Phinney
>     Project Lead            | [hidden email]
>     Zend Framework          | http://framework.zend.com/
>     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>
>
>
> --
> A.J. Brown
> Software Engineer, ZCE
> blog : http://ajbrown.org
> talk  : (937) 540-0099
> chat : IntypicaAJ

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc