Welcome Guest, Not a member yet? Register   Sign In
ToastX - Controller Unit Testing
#1

[eluser]Oxaric[/eluser]
Hello!

I liked the controller unit testing framework Toast however I felt it could track and show a lot more information such as what lines errors occur on and total number of tests run. I tried to e-mail the author of Toast but got no reply so I decided to fork the project and created ToastX.

The original Toast is located at: http://jensroland.com/projects/toast/

The ToastX fork is located at: https://sourceforge.net/projects/toastx/

I hope ToastX can help make things easier for someone. I am very busy these days and would love to have another developer with any ideas or passion for new features/options.

Have a nice day!

-Louis Casillas ([email protected])
#2

[eluser]g_montel[/eluser]
thanks for that, I will check it out very soon
#3

[eluser]g_montel[/eluser]
you should change the example_tests.php file to include your ToastX and not Toast

require_once(APPPATH . '/controllers/test/ToastX.php');

class Example_tests extends ToastX
{
function Example_tests()
{
parent::ToastX(__FILE__);
#4

[eluser]Oxaric[/eluser]
Great catch! That was a mismatch of files! I'm uploading the fixed example_tests.php now.
#5

[eluser]OliverHR[/eluser]
Great "re-work" man, why not join efforts??.

A suggestion for those who have problems, change to lowercase "ToastX.php" to "toastx.php", then in toastx.php change this line:

Code:
var $skip = array(
    'toastx.php', // <-- now :: before --&gt; ToastX.php
    'forms.php',
    'example_tests.php',
    'selenium.php'
    );

Now our tests looks like:


Code:
&lt;?php
require_once(APPPATH . '/controllers/test/toastx.php');

class My_Test extends ToastX
{
    function My_test()
    {
        parent::ToastX();
    }
}

Then to call all controllers in test folder (working locally):

http://localhost/test/toastx
#6

[eluser]Oxaric[/eluser]
Your changes sound great! I sent you a PM. Let me know if you have time to add your changes to the main sourceforge site.

Thanks again!

-Louis
#7

[eluser]JensRoland[/eluser]
Very nice work, Louis.

I'm sorry I missed your email. We should definitely merge your code into the official Toast release. I will get on it right away.

/Jens Roland (Toast)




Theme © iAndrew 2016 - Forum software by © MyBB