mercredi 1 juin 2016

PHPUnit testing method that instance others objects

How testing method that instance multiple objects. This is a sample of class

class A {
    public function method1($data) {
         $a = new object1($data);
         $r = $a->hydrate();

         $b = new object2($data);
         $o = $b->hydrate();
         $r->setB($b);

         $c = new object3($data);
         $o = $c->hydrate();
         $r->setC($o);

         return $a;
    }
}

Aucun commentaire:

Enregistrer un commentaire