output in phpunit

Topics: Developer Forum
Apr 4, 2014 at 3:54 PM
Hi guys.
I dont know where to see the version of the PHPExcel.

I am trying to make some unitTests and my code that I am testing is using PHPExcel... and it is outputing some stuff and is not working to disable it with
b_start();
$out1 = ob_get_contents();
ob_end_clean();

any idea pls? I cant test my code because of this.

How do I disable the output pls?

It looks smth like:

...<b>DOM ELEMENT: </b>HTML<br /><b>DOM ELEMENT: </b>BODY<br /><b>DOM ELEMENT: </b>P<br />START OF PARAGRAPH: <br />END OF PARAGRAPH:<br />FLUSH CELL: A1 => campa......

Cheers!
Coordinator
Apr 4, 2014 at 4:40 PM
That looks like residual diagnostics from the previous version of the HTML Reader, it shouldn't be displayed in the latest version of PHPExcel
Apr 4, 2014 at 4:47 PM
Thanks but I am afraid at this moment an upgrade is not possible for my project.
I will have to find a workaround.
I see you have unitests so you must have aleady dealt with it but cant find how you can block the output.
Coordinator
Apr 4, 2014 at 4:53 PM
You can't block the output. You'll have to go and comment out those lines in that file
Apr 4, 2014 at 4:58 PM
I found where that happens but not going to go trough code review - we cant change vendor apps.
Thanks anyway.
Apr 8, 2014 at 11:59 AM
Hi, we decided to change the code after all so I commented those lines out.
Now I am wondering if is working with the CSV format - I found this comment
case 'csv':
                // Do nothing
                // We must not try to use CSV reader since it loads
                // all files including Excel files etc.
                break;
and the PHPExcel_Reader_HTML - the one that is trying to read the file is returning one line for all the CSV lines...
Any idea pls on the CSV reader?