/** * Create currency entity and persist it * @param string $code Currency code * @param boolean $activated Define if currency is activated or not * * @return \Pim\Bundle\CatalogBundle\Entity\Currency */ protected function createCurrency($code, $activated = false) { $currency = new Currency(); $currency->setCode($code); $currency->setActivated($activated); return $currency; }
/** * Test related method */ public function testToString() { $this->assertEquals('', $this->currency->__toString()); $expectedCode = 'test-code'; $this->currency->setCode($expectedCode); $this->assertEquals($expectedCode, $this->currency->__toString()); }
function getChannel() { $channel = new Channel(); $channel->setCode('catalog'); $currency = new Currency(); $currency->setCode('EUR'); $channel->addCurrency($currency); return $channel; }
/** * Create a currency for testing * * @param string $code * * @return \Pim\Bundle\CatalogBundle\Entity\Currency */ protected function createCurrency($code) { $currency = new Currency(); $currency->setCode($code); return $currency; }
/** * {@inheritDoc} */ public function setCode($code) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCode', array($code)); return parent::setCode($code); }