1
0
mirror of synced 2025-03-14 00:26:08 +03:00

Removing old UnitOfWorkPerformanceTest

This commit is contained in:
Marco Pivetta 2016-05-26 22:28:54 +02:00 committed by Luís Cobucci
parent b1bbad3b15
commit 77ce354f18
No known key found for this signature in database
GPG Key ID: EC61C5F01750ED3C

View File

@ -1,50 +0,0 @@
<?php
namespace Doctrine\Tests\ORM\Performance;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\OrmPerformanceTestCase;
/**
* Description of InsertPerformanceTest
*
* @author robo
* @group performance
*/
class UnitOfWorkPerformanceTest extends OrmPerformanceTestCase
{
protected function setUp()
{
$this->useModelSet('cms');
parent::setUp();
}
public function testComputeChanges()
{
$n = 100;
$users = [];
for ($i=1; $i<=$n; ++$i) {
$user = new CmsUser;
$user->status = 'user';
$user->username = 'user' . $i;
$user->name = 'Mr.Smith-' . $i;
$this->_em->persist($user);
$users[] = $user;
}
$this->_em->flush();
foreach ($users AS $user) {
$user->status = 'other';
$user->username = $user->username . '++';
$user->name = str_replace('Mr.', 'Mrs.', $user->name);
}
$s = microtime(true);
$this->_em->flush();
$e = microtime(true);
echo ' Compute ChangeSet '.$n.' objects in ' . ($e - $s) . ' seconds' . PHP_EOL;
}
}