Пример #1
0
 public function testGetGeometryVector2()
 {
     $vector2 = new CM_Geometry_Vector2(1.1, 2.2);
     $params = new CM_Params(array('vector2' => $vector2));
     $value = $params->getGeometryVector2('vector2');
     $this->assertInstanceOf('CM_Geometry_Vector2', $value);
     $this->assertSame(1.1, $value->getX());
     $this->assertSame(2.2, $value->getY());
     $exception = $this->catchException(function () {
         $params = new CM_Params(array('vector2' => 'foo'));
         $params->getGeometryVector2('vector2');
     });
     $this->assertInstanceOf('CM_Exception_InvalidParam', $exception);
     $this->assertSame('Not enough parameters', $exception->getMessage());
 }