コード例 #1
0
ファイル: Calculator.php プロジェクト: juhaszjt/tdd-training
 /**
  * Constructor.
  *
  * @param Math $math
  */
 public function __construct(Math $math)
 {
     $this->math = $math;
     $this->operators = $math->getOperators();
     $this->operatorsRegexp = '\\' . implode('\\', $this->operators);
 }
コード例 #2
0
ファイル: MathTest.php プロジェクト: juhaszjt/tdd-training
 public function testOperatorList()
 {
     $this->assertEquals($this->math->getOperators(), array(Math::OPERATOR_ADDITION, Math::OPERATOR_SUBTRACTION));
 }