Ejemplo n.º 1
0
 public function testifobjectequals()
 {
     $calculator_obj = new Calculator();
     $calculator_obj->setOperand(array(4, 2));
     $calculator_obj->setOperation(new Addition());
     $this->assertEquals(6, (int) $calculator_obj->process());
 }
Ejemplo n.º 2
0
<?php

include 'bootstrap.php';
use Calculator\Calculator;
use Calculator\Operation\Addition;
$calculator_obj = new Calculator();
$calculator_obj->setOperand(array(4, 2));
$calculator_obj->setOperation(new Addition());
echo $calculator_obj->process();