Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created a test case for DDC6558 #6559

Closed
wants to merge 1 commit into from

Conversation

jeroenvrooij
Copy link

No description provided.

class DDC6558Staff extends DDC6558Employee
{
/** @Column(type="string") */
public $phoneNumber;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all fields and properties that aren't required - if this test just needs the ID, let's only use that


$persistedDeveloper = $this->_em->find(DDC6558Person::class, $developer->id);

$this->assertSame($persistedDeveloper->emailAddress, $developer->emailAddress);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self::assertInstanceOf(DDC6558Developer::class, $persistedDeveloper)


$persistedDeveloper = $this->_em->find(DDC6558Employee::class, $developer->id);

$this->assertSame($persistedDeveloper->emailAddress, $developer->emailAddress);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self::assertInstanceOf(DDC6558Developer::class, $persistedDeveloper)

* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"staff" = "DDC6558Staff", "developer" = "DDC6558Developer"})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one inheritance map is allowed at top level - this usage is invalid and should probably be reported by the schema validation

/**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one discriminator column is allowed at top level - this usage is invalid and should probably be reported by the schema validation


/**
* @Entity
* @InheritanceType("JOINED")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one inheritance type definition is allowed at top level - this usage is invalid and should probably be reported by the schema validation

@Ocramius
Copy link
Member

Closing as invalid: we don't allow mapping inheritance definitions at multiple levels of the inheritance - only at root level.

This is possibly a schema validation issue instead, as the tooling should report that a discriminator already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants