mercredi 19 juin 2019

How to define and code custom unit-test in raw PHP?

I am using some special PHP framework. I can't use any unit-test frameworks by some reasons like PHPunit or codeception. So i need to write my custom code to achieve that. Is there any examples could finish the job?

Can i use this method instead of using framework?

    public function testFailure()
    {
       $a = 1; $b = 0;
       if($a !=== b){
          //throw exception here
       }
    }

Instead-

    public function testFailure()
    {
        $this->assertEquals(1, 0); //return false
    }

Aucun commentaire:

Enregistrer un commentaire