On Fri, Jul 13, 2012 at 6:38 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
These days I'm having problems with improving the test cases. It's not a good idea to run all the tests after improve test for each function since it takes much time. As well I can't run tests individually without errors again and again. (File not found, undefined constant, undefined variable) I cannot find that my tests are correct or not.
First of all the tests should run standalone as well as part of testsuite. I see lot of tests fail in both modes, so maybe that's the reason why it fails for you?
Please suggest me some way to get rid of this problem. Its very helpful if you can give one example for fixing a failing test
in
PMA_DisplayResults_test.php
Fix the tests and code to work together :-).
Okay I'll try again Michal
Hi Michal,
I managed to run only needed tests by modifying phpunit.xml.dist file. And now Its no need to wait till all tests are running.
The problem for the errors in PMA_DisplayResults_test.php tests is not properly set the properties of PMA_DisplayResults class. So that, I get following two types of errors :
- Trying to get property of non-object - $fields_meta[0]->table
- Invalid argument supplied for foreach() - foreach
($vertical_display[$operation] as $val)
I try to set those parameters by calling setProperties() method. As I found, the conditions inside __set and __get method are not satisfying.
That is, if (property_exists($this, $property))
But if I print the object at testing time, it shows me the properties are actually there itself. I am confusing about this. Do you have any idea or suggestion for this ?
Regards !
*Chanaka*
Hi Michal,
I just found that, property_exists method cannot detect properties in magic method __get, from the manual [0]. I'll try with changing the method names.
[0] : http://php.net/manual/en/function.property-exists.php
Regards !
*Chanaka*