Ejemplo n.º 1
0
 public function testEmailOrigins()
 {
     $entity = new User();
     $origin1 = new InternalEmailOrigin();
     $origin2 = new InternalEmailOrigin();
     $this->assertCount(0, $entity->getEmailOrigins());
     $entity->addEmailOrigin($origin1);
     $entity->addEmailOrigin($origin2);
     $this->assertCount(2, $entity->getEmailOrigins());
     $this->assertSame($origin1, $entity->getEmailOrigins()->first());
     $this->assertSame($origin2, $entity->getEmailOrigins()->last());
     $entity->removeEmailOrigin($origin1);
     $this->assertCount(1, $entity->getEmailOrigins());
     $this->assertSame($origin2, $entity->getEmailOrigins()->first());
 }