2011-03-09 23:14:54 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
|
|
|
|
2016-05-11 01:55:12 +07:00
|
|
|
use Doctrine\Tests\Models\CMS\CmsUser;
|
|
|
|
use Doctrine\Tests\OrmFunctionalTestCase;
|
2011-03-09 23:14:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @group DDC-1050
|
|
|
|
*/
|
2016-05-11 01:55:12 +07:00
|
|
|
class DDC1050Test extends OrmFunctionalTestCase
|
2011-03-09 23:14:54 +01:00
|
|
|
{
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->markTestSkipped('performance skipped');
|
2015-11-06 15:23:16 +00:00
|
|
|
|
2011-03-09 23:14:54 +01:00
|
|
|
$this->useModelSet('cms');
|
2015-11-06 15:23:16 +00:00
|
|
|
|
2011-03-09 23:14:54 +01:00
|
|
|
parent::setUp();
|
|
|
|
}
|
2011-12-19 22:56:19 +01:00
|
|
|
|
2011-03-09 23:14:54 +01:00
|
|
|
public function testPerformance()
|
|
|
|
{
|
|
|
|
for ($i = 2; $i < 10000; ++$i) {
|
2016-05-11 01:55:12 +07:00
|
|
|
$user = new CmsUser();
|
2011-03-09 23:14:54 +01:00
|
|
|
$user->status = 'developer';
|
2016-05-11 02:41:26 +07:00
|
|
|
$user->username = 'jwage'.$i;
|
2011-03-09 23:14:54 +01:00
|
|
|
$user->name = 'Jonathan';
|
|
|
|
$this->_em->persist($user);
|
|
|
|
}
|
|
|
|
$this->_em->flush();
|
|
|
|
$this->_em->clear();
|
2011-12-19 22:56:19 +01:00
|
|
|
|
2011-03-09 23:14:54 +01:00
|
|
|
$s = microtime(true);
|
2016-12-08 18:01:04 +01:00
|
|
|
$users = $this->_em->getRepository(CmsUser::class)->findAll();
|
2011-03-09 23:14:54 +01:00
|
|
|
$e = microtime(true);
|
|
|
|
echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL;
|
|
|
|
}
|
2014-04-07 14:43:25 +02:00
|
|
|
}
|