예제 #1
0
 /**
  * @covers \PHP\Manipulator\AHelper::evaluateConstraint
  */
 public function testEvaluateConstraintThrowsExceptionIfConstraintIstNotValidConstraint()
 {
     $abstractHelper = new AHelper();
     $token = Token::factory(array(T_WHITESPACE, "\n"));
     $constraint = new \stdClass();
     try {
         $abstractHelper->evaluateConstraint($constraint, $token);
         $this->fail('Expected exception not thrown');
     } catch (\Exception $e) {
         $this->assertEquals('constraint is not instance of PHP\\Manipulator\\TokenConstraint', $e->getMessage(), 'Wrong exception message');
     }
 }