You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All key points in this issue are now covered by unit tests. While there certainly are even more things that could be tested (especially rasterization), those would be out of scope here. Closing this issue now.
Intro
As it currently stands, this project has almost no unit tests, despite having the testing framework and CI set up. The time has come to change that.
The following list shall track the things that need to have tests added.
Task List
Base Classes
SVG\SVG
convertUnit
(pt, pc, cm, mm, in, %, px; no unit; different parameter types)convertAngleUnit
parseColor
(named colors, nonexisting color names; HEX_6, HEX_6, RGB, RGBA, HSL, HSLA (all with overflow))SVG\SVGImage
getDocument
toRasterImage
(return type; width, height)__toString
(callstoXMLString
)toXMLString
fromString
(return type)fromFile
Nodes
SVG\Nodes\SVGNode
constructFromAttributes
(constructs child class)getName
(returnsstatic::TAG_NAME
)getStyle
(existent entry; nonexistent entry)setStyle
(property is updated; value converted to string)getValue
setValue
removeStyle
(property is unset)getAttribute
(existent entry; nonexistent entry)setAttribute
(property is updated; value converted to string)removeAttribute
(property is unset)getSerializableAttributes
(returns$this->attributes
)getSerializableStyles
(returns$this->styles
)getViewBox
SVG\Nodes\SVGNodeContainer
addChild
(duplicate, self; removes from previous; adds, container styles ??)removeChild
(instance vs. index; removes, sets$parent
; nonexistent child)rasterize
(display: none
; calls children; ignoresvisibility
)getElementsByTagName
getElementsByClassName
Embedded
SVG\Nodes\Embedded\SVGImageElement
getHref
(both versions)setHref
(setsxlink:href
)rasterize
(callsrender('image', ...)
; correct options;display
,visibility
)Shapes
SVG\Nodes\Shapes\SVGCircle
rasterize
(callsrender('ellipse', ...)
; correct options;display
,visibility
)SVG\Nodes\Shapes\SVGEllipse
rasterize
(callsrender('ellipse', ...)
; correct options;display
,visibility
)SVG\Nodes\Shapes\SVGLine
rasterize
(callsrender('line', ...)
; correct options;display
,visibility
)SVG\Nodes\Shapes\SVGPath
rasterize
(calls parser and approximator; callsrender('polygon', ...)
; correct options;display
,visibility
)SVG\Nodes\Shapes\SVGPolygonalShape
constructFromAttributes
addPoint
(array vs. floats)removePoint
(removes; out of range behavior)getPoint
setPoint
getSerializableAttributes
(includespoints
correctly stringified)SVG\Nodes\Shapes\SVGPolygon
rasterize
(callsrender('polygon', ...)
; correct options;display
,visibility
)SVG\Nodes\Shapes\SVGPolyline
rasterize
(callsrender('polygon', ...)
; correct options;display
,visibility
)SVG\Nodes\Shapes\SVGRect
rasterize
(callsrender('rect', ...)
; correct options;display
,visibility
)Structures
SVG\Nodes\Structures\SVGDefs
rasterize
(does not render children)SVG\Nodes\Structures\SVGDocumentFragment
getComputedStyle
(initial style if not explicit)getSerializableAttributes
(namespaces if root,xmlns:
prefix, xlink (once!); width and height if not default)getElementById
SVG\Nodes\Structures\SVGStyle
setType
getType
setCss
getCss
Rasterization
SVG\Rasterization\SVGRasterizer
getPathParser
getPathApproximator
getDocumentWidth
,getDocumentHeight
(pixel conversion; default value)getWidth
,getHeight
getScaleX
,getScaleY
(viewbox vs. no viewbox)getOffsetX
,getOffsetY
(viewbox vs. no viewbox)getViewBox
getImage
(returns working image)Path
SVG\Rasterization\Path\SVGArcApproximator
approximate
SVG\Rasterization\Path\SVGBezierApproximator
quadratic
cubic
SVG\Rasterization\Path\SVGPathApproximator
approximate
(?)SVG\Rasterization\Path\SVGPathParser
SVG\Rasterization\Path\SVGPolygonBuilder
build
getFirstPoint
getLastPoint
getPosition
addPoint
addPointRelative
addPoints
Renderers
SVG\Rasterization\Renderers\SVGRenderer
render
(callsprepareRenderParams
,renderFill
(if needed),renderStroke
(if needed); correct color conversion)Reading
SVG\Reading\SVGReader
SVGImage
ornull
on errorWriting
SVG\Writing\SVGWriter
SVGStyle
content in CDATAThe text was updated successfully, but these errors were encountered: