/** * @test */ public function canGetAttributeByName() { $attribute1 = new ProductAttribute(); $attribute1->setName('color'); $attribute1->setType(ProductAttribute::TYPE_TEXT); $attribute1->setForFaceting(true); $attribute1->setForSorting(true); $attribute1->setForSearching(true); $attribute1->addValue("red"); $this->product->addAttribute($attribute1); $attribute2 = new ProductAttribute(); $attribute2->setName('defaults'); $attribute2->setType(ProductAttribute::TYPE_STRING); $attribute2->addValue("i like searchperience"); $attribute2->addValue("foobar"); $this->product->addAttribute($attribute2); $this->assertEquals($attribute2, $this->product->getAttributeByName("defaults")); }