Programming Language PHP

Namespace Oro\Component\ExpressionLanguage\Node

Class GetAttrNodeFactory

Total Examples 2

2 code examples of PHP Oro\Component\ExpressionLanguage\Node\GetAttrNodeFactory extracted from open source projects

Was this example useful?
0
                                                    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);
    }
                                            
Was this example useful?
0
                                                    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);
    }
                                            
GetAttrNodeFactory's Other Methods
GetAttrNodeFactory's Other Methods