/** * @param string $fieldName * @return FieldRef */ public function fieldRef($fieldName = null) { $field = new FieldRef(); if (null !== $fieldName) { $field->attribute('name', $fieldName); } $this->append($field); return end($this->children); }
/** * @covers \DCarbone\Camel\Node\AbstractNode::getAllowableParents * @uses \DCarbone\Camel\Node\AbstractNode * @uses \DCarbone\Camel\Node\FieldRef * @depends testCanInitializeFieldRefNode * @param \DCarbone\Camel\Node\FieldRef $fieldRef */ public function testHasCorrectAllowableParents(\DCarbone\Camel\Node\FieldRef $fieldRef) { $parents = $fieldRef->getAllowableParents(); $this->assertInternalType('array', $parents); $this->assertCount(17, $parents); $this->assertContains('BeginsWith', $parents); $this->assertContains('Contains', $parents); $this->assertContains('DateRangesOverlap', $parents); $this->assertContains('Eq', $parents); $this->assertContains('FieldRefs', $parents); $this->assertContains('Geq', $parents); $this->assertContains('GroupBy', $parents); $this->assertContains('Gt', $parents); $this->assertContains('In', $parents); $this->assertContains('Includes', $parents); $this->assertContains('IsNotNull', $parents); $this->assertContains('IsNull', $parents); $this->assertContains('Leq', $parents); $this->assertContains('Lt', $parents); $this->assertContains('Neq', $parents); $this->assertContains('NotIncludes', $parents); $this->assertContains('OrderBy', $parents); }