Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/881dd1939fd47b9d32c4 to your computer and use it in GitHub Desktop.
Save doctrinebot/881dd1939fd47b9d32c4 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-331 - https://github.com/doctrine/doctrine2/issues/4104
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
require_once __DIR__ . '/../../../TestInit.php';
use Doctrine\Tests\Models\Company\CompanyPerson,
Doctrine\Tests\Models\Company\CompanyEmployee,
Doctrine\Tests\Models\Company\CompanyManager,
Doctrine\Tests\Models\Company\CompanyOrganization,
Doctrine\Tests\Models\Company\CompanyEvent,
Doctrine\Tests\Models\Company\CompanyAuction,
Doctrine\Tests\Models\Company\CompanyRaffle,
Doctrine\Tests\Models\Company\CompanyCar;
/**
* Functional tests for the Class Table Inheritance mapping strategy.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class DDCx001Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
protected function setUp() {
$this->useModelSet('company');
parent::setUp();
}
public function testSelectFieldOnRootEntity()
{
$employee = new CompanyEmployee;
$employee->setName('Roman S. Borschel');
$employee->setSalary(100000);
$employee->setDepartment('IT');
$this->_em->persist($employee);
$this->_em->flush();
$this->_em->clear();
$dql = 'SELECT e.name FROM Doctrine\Tests\Models\Company\CompanyEmployee e';
$result = $this->_em->createQuery($dql)->getScalarResult();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment