/** * @covers generateCss */ public function testGenerateCss() { $env = new Context(); $output = new StandardOutput(); $o = new OperationNode('+', [new AnonymousNode('10'), new AnonymousNode('15')]); $o->generateCss($env, $output); $this->assertEquals('10+15', $output->toString()); }
/** * Compiles the node. * * @param Context $context The context * @param array|null $arguments Array of arguments * @param bool|null $important Important flag * * @return NegativeNode|Node */ public function compile(Context $context, $arguments = null, $important = null) { if ($context->isMathOn()) { $operation = new OperationNode('*', [new DimensionNode('-1'), $this->value]); return $operation->compile($context); } else { return new self($this->value->compile($context)); } }