Programming Language PHP
Namespace Oro\Component\ExpressionLanguage\Node
Class GetAttrNodeFactory
Method/Function createNode
Total Examples 2
2 code examples of PHP Oro\Component\ExpressionLanguage\Node\GetAttrNodeFactory::createNode extracted from open source projects
public function testCreateNodeThrowsExceptionWhenUndefinedType(): void
{
$node = new Node();
$attribute = new Node();
$arguments = new ArrayNode();
$type = 42;
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('Undefined attribute type 42');
GetAttrNodeFactory::createNode($node, $attribute, $arguments, $type);
}
public function testCreateNodeThrowsExceptionWhenMethodIsNotSupported(): void
{
$node = new Node();
$attribute = new Node([], ['value' => 'unsupported']);
$arguments = new ArrayNode();
$arguments->addElement(new ArrayNode());
$type = GetAttrNodeFactory::METHOD_CALL;
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage(
'Unsupported method: unsupported(), supported methods are all(), any(), sum()'
);
GetAttrNodeFactory::createNode($node, $attribute, $arguments, $type);
}