/** * @test */ public function mapRelationFieldAllFields() { $command = new MapAllFieldsCommand(new MetaInformationFactory($this->reader)); $entity1 = new ValidTestEntity(); $entity1->setTitle('title 1'); $entity1->setText('text 1'); $entity2 = new ValidTestEntity(); $entity2->setTitle('title 2'); $entity1->setText('text 2'); $collection = new ArrayCollection(); $collection->add($entity1); $collection->add($entity2); $metaInformation = MetaTestInformationFactory::getMetaInformation(new ValidTestEntityWithCollection()); $fields = $metaInformation->getFields(); $fields[] = new Field(array('name' => 'collection', 'type' => 'strings', 'boost' => '1', 'value' => $collection)); $metaInformation->setFields($fields); $actual = $command->createDocument($metaInformation); $this->assertArrayHasKey('collection_ss', $actual->getFields()); $collectionField = $actual->getFields()['collection_ss']; $this->assertEquals(2, count($collectionField), 'collection contains 2 fields'); $this->assertEquals(3, count($collectionField[0]), 'field has 2 properties'); }
/** * @When /^I update one attribute$/ */ public function iUpdateOneAttribute() { $this->entity->setText('text has changed'); }