public function testString() { $factory = new \ODataQuery\Filter\ODataFilterFactory('TestValue'); $factory->concat('other')->substring($propLength = new \ODataQuery\Filter\Operators\Functional\String\ODataLengthOperator($factory->originalProperty), $propLength->add(1))->notEqualsString('p'); $this->assertEquals('substring(concat(TestValue, \'other\'), length(TestValue), length(TestValue) add 1) ne \'p\'', (string) $factory); $factory = new \ODataQuery\Filter\ODataFilterFactory('TestValue'); $factory->contains('op')->not(); $this->assertEquals('not contains(TestValue, \'op\')', (string) $factory); }
public function testLength() { $output = new \ODataQuery\Filter\Operators\Functional\String\ODataLengthOperator('TestValue'); $this->assertEquals("length(TestValue)", (string) $output); $this->assertEquals("length(TestValue) eq 5", (string) $output->equals(5)); $this->assertEquals("length(TestValue) add 4 eq 5", (string) $output->add(4)->equals(5)); $add = new \ODataQuery\Filter\Operators\Logical\Mathematical\ODataAddOperator('TestValue', 6); $this->assertEquals("length(TestValue) eq (TestValue add 6)", (string) $output->equals($add)); }