Example #1
0
 function it_should_transform_an_array_to_an_entity()
 {
     $context = new Context('id');
     $class = self::className;
     $context->setTransformedData(new $class());
     $entity = $this->transform([123, 'John', 'Smith'], $context);
     $entity->shouldHaveType(self::className);
     $entity->id->shouldBe(123);
     $entity->name->shouldBe('John');
     $entity->surname->shouldBe('Smith');
 }