Skip to content

created a test case for DDC6558#6559

Closed
jeroenvrooij wants to merge 1 commit intodoctrine:masterfrom
jeroenvrooij:DDC6558_test_case
Closed

created a test case for DDC6558#6559
jeroenvrooij wants to merge 1 commit intodoctrine:masterfrom
jeroenvrooij:DDC6558_test_case

Conversation

@jeroenvrooij
Copy link
Copy Markdown

No description provided.

class DDC6558Staff extends DDC6558Employee
{
/** @Column(type="string") */
public $phoneNumber;
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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