/** * Test related methods */ public function testGettersSetters() { $this->assertNull($this->field->getId()); $this->assertNull($this->field->getSource()); $this->assertNull($this->field->getDestination()); $this->assertFalse($this->field->isIdentifier()); $this->assertNull($this->field->getItem()); $this->field->setSource('my-code-src'); $this->field->setDestination('my-code-dest'); $this->field->setIdentifier(true); $item = new ItemMapping(); $this->field->setItem($item); $this->assertEquals($this->field->getSource(), 'my-code-src'); $this->assertEquals($this->field->getDestination(), 'my-code-dest'); $this->assertTrue($this->field->isIdentifier()); $this->assertEquals($this->field->getItem(), $item); }
/** * Test related methods */ public function testGettersSetters() { $this->assertEquals(count($this->item->getFields()), 0); $this->assertEquals($this->item->getId(), 0); $field = new FieldMapping(); $field->setSource('my-code-src'); $field->setDestination('my-code-dest'); $field->setIdentifier(true); $this->item->addField($field); $this->assertEquals(count($this->item->getFields()), 1); $this->item->removeField($field); $this->assertEquals(count($this->item->getFields()), 0); }
/** * {@inheritDoc} */ public function setDestination($destination) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDestination', array($destination)); return parent::setDestination($destination); }