Tuesday, January 29, 2013

CakeTestCase, output and graceful failing

Pretty newb at Testing, but I wish to create a list-of-feature-test with some useful output.

I have created a test case for a parser which loads about a 100 input + expected pairs from an external definition file.

So far so good, test runs OK with this method:


    public function testFormats(){
        foreach ($this->tests as $case){
            $this->assertTextEquals(
                    $this->Parser->parse($case['input']), 
                    $case['expected'], 
                    $case['message']
                    );
        }
        
    }

But currently, I can only see if all test pass.

I have some features that are still being developed and I'm trying to push towards a test-driven-development pattern here.

This means I have many test I have made that are meant to fail, but I would like them to do so gracefully.

Is there a way a TestCase can output a list of all tests with "OK" or "FAILED" results, so other developers and end-users can see which of the features are safe to use?

Thanks!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: