1
0
mirror of synced 2025-02-02 21:41:45 +03:00

Removing old inheritance persister test

This commit is contained in:
Marco Pivetta 2016-05-26 22:10:20 +02:00 committed by Luís Cobucci
parent 52402917a0
commit 8ec186f095
No known key found for this signature in database
GPG Key ID: EC61C5F01750ED3C

View File

@ -1,69 +0,0 @@
<?php
namespace Doctrine\Tests\ORM\Performance;
use Doctrine\ORM\Query;
use Doctrine\Tests\Models\Company\CompanyContract;
use Doctrine\Tests\Models\Company\CompanyEmployee;
use Doctrine\Tests\Models\Company\CompanyFixContract;
use Doctrine\Tests\Models\Company\CompanyFlexContract;
use Doctrine\Tests\Models\Company\CompanyFlexUltraContract;
use Doctrine\Tests\OrmFunctionalTestCase;
/**
* @group performance
*/
class InheritancePersisterPerformanceTest extends OrmFunctionalTestCase
{
protected function setUp()
{
$this->useModelSet('company');
parent::setUp();
}
public function testCompanyContract()
{
$person = new CompanyEmployee();
$person->setName('Poor Sales Guy');
$person->setDepartment('Sales');
$person->setSalary(100);
$this->_em->persist($person);
for ($i = 0; $i < 33; $i++) {
$fix = new CompanyFixContract();
$fix->setFixPrice(1000);
$fix->setSalesPerson($person);
$fix->markCompleted();
$this->_em->persist($fix);
$flex = new CompanyFlexContract();
$flex->setSalesPerson($person);
$flex->setHoursWorked(100);
$flex->setPricePerHour(100);
$flex->markCompleted();
$this->_em->persist($flex);
$ultra = new CompanyFlexUltraContract();
$ultra->setSalesPerson($person);
$ultra->setHoursWorked(150);
$ultra->setPricePerHour(150);
$ultra->setMaxPrice(7000);
$this->_em->persist($ultra);
}
$this->_em->flush();
$this->_em->clear();
$start = microtime(true);
$contracts = $this->_em->getRepository(CompanyContract::class)->findAll();
echo "99 CompanyContract: " . number_format(microtime(true) - $start, 6) . "\n";
$this->assertEquals(99, count($contracts));
$this->_em->clear();
$start = microtime(true);
$contracts = $this->_em->getRepository(CompanyContract::class)->findAll();
echo "99 CompanyContract: " . number_format(microtime(true) - $start, 6) . "\n";
$this->assertEquals(99, count($contracts));
}
}