what am i doing wrong? : unit testing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
urboyfriend
Forum Newbie
Posts: 11
Joined: Tue Sep 06, 2011 6:29 pm

what am i doing wrong? : unit testing

Post by urboyfriend »

i am reading this tutorial

http://www.phpeveryday.com/articles/Sim ... --P56.html

i am using simpletest_1.1alpha2.tar.gz

my simpletest folder is inside htdocs/test
my test.php is also inside htdocs/test

i got this error

http://i172.photobucket.com/albums/w11/ ... terror.jpg

i was expecting this

http://farm4.static.flickr.com/3126/234 ... f5.jpg?v=0

what am i doing wrong?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: what am i doing wrong? : unit testing

Post by Christopher »

That is an old tutorial probably, so it is now __construct(). You don't need the constructor anyway, just do:

Code: Select all

class TestingTestCase extends UnitTestCase{
	 
    public function TestInterest(){
        $this->assertEqual(5, interest_per_year(100));
    }
	     
}
(#10850)
Post Reply