/** * Test getter/setter for data property */ public function testGetSetData() { $expectedData = 'test-data'; $this->assertNull($this->price->getData()); $this->assertEntity($this->price->setData($expectedData)); $this->assertEquals($expectedData, $this->price->getData()); }
function it_normalizes_a_price_into_mongodb_document($mongoFactory, ProductPrice $price, \MongoId $mongoId) { $mongoFactory->createMongoId()->willReturn($mongoId); $price->getCurrency()->willReturn('USD'); $price->getData()->willReturn(9.99); $this->normalize($price, 'mongodb_document')->shouldReturn(['_id' => $mongoId, 'currency' => 'USD', 'data' => 9.99]); }
/** * {@inheritDoc} */ public function getData() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getData', array()); return parent::getData(); }
function it_normalizes_a_collection_of_product_prices($value, $attribute, ProductPrice $price1, ProductPrice $price2) { $attribute->isScopable()->willReturn(true); $attribute->isLocalizable()->willReturn(false); $value->getData()->willReturn([$price1, $price2]); $price1->getData()->willReturn('10.0'); $price1->getCurrency()->willReturn('EUR'); $price2->getData()->willReturn('12.0'); $price2->getCurrency()->willReturn('currency_code'); $this->normalize($value, 'MagentoArray', $this->globalContext)->shouldReturn(['attribute_code' => '12.0']); }