コード例 #1
0
 /**
  * Test all getters for the values set with the constructor.
  */
 public function testConstructorAccessors()
 {
     $ifCode = mt_rand(1, 100);
     $elseCode = mt_rand(1, 100);
     $precedence = mt_rand(1, 100);
     $allowShorthand = mt_rand(0, 1);
     $closure = function () {
     };
     $operator = new TernaryOperator($ifCode, $elseCode, $precedence, TernaryOperator::LEFT, $allowShorthand, $closure);
     $this->assertSame($ifCode, $operator->getIfCode());
     $this->assertSame($elseCode, $operator->getElseCode());
     $this->assertSame($precedence, $operator->getPrecedence());
     $this->assertSame($allowShorthand, $operator->isShorthandAllowed());
     $this->assertSame($closure, $operator->getNode());
 }