interface LiczbyInterface
{
public function dodaj($n);
public function toInt();
}
class Liczby implements LiczbyInterface
{
public function __construct()
{
}
public function toInt()
{
}
}
I pozniej mialem do tego takie testy i na podstawie tych testow mial pokazac poprawny wynik
public function testConstruct()
{
$n = new Number;
$this->porownaj(0, $n->toInt());
$n = new Number(0);
$this->porownaj(0, $n->toInt());
$n = new Number(7);
$this->porownaj(3, $n->toInt());
}
public function testDodaj()
{
$n = new Number;
$n->add(5);
$this->porownaj(5, $n->toInt());
$n->add(-7);
$this->porownaj(-2, $n->toInt());
}
to co powinno byc w tej funkcji dodaj i w tej funkcji toInt() ? bo tego nie moge skumac