M_A_K
M_A_K

Reputation: 378

Customize CakePHP Test Suite Messages

I want to confirm that, is this possible to customize Cakephp test suite(Unit Testing) message to our desired message on success & failed by default? It shows the following message

enter image description here

Now i want to customize time duration micro second to second by rounding function & also change Passed message to success OR my own message. How can i achieved this goal? Thanx in Advance

Upvotes: 0

Views: 110

Answers (1)

Grambot
Grambot

Reputation: 4524

Within ./lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php you can modify how the TestSuite reports stats.

I'm using a different version of CakePHP, but for me, Line 151 is this:

echo '<p><strong>Time:</strong> ' . $result->time() . ' seconds</p>';

You can take the $result->time() and run it through whatever PHP functions you want to get the output you're after. For that matter $result is set during your test cases is it not?

Upvotes: 1

Related Questions