private $calculator;
protected function setUp():void
{
$this->calculator = new Calculator();
}
protected function tearDown():void
{
$this->calculator = NULL;
}
public function testAdd() //имена методов тестирования должны начинаться с test... и public
{
$result = $this->calculator->add(1, 2);
$this->assertEquals(3, $result);
}
}
Обсуждают сегодня