Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / ORM / Functional / Ticket / DDC1050Test.php
1 <?php
2
3 namespace Doctrine\Tests\ORM\Functional\Ticket;
4
5 use Doctrine\Common\Collections\ArrayCollection;
6 require_once __DIR__ . '/../../../TestInit.php';
7
8 /**
9  * @group DDC-1050
10  */
11 class DDC1050Test extends \Doctrine\Tests\OrmFunctionalTestCase
12 {
13     public function setUp()
14     {
15         $this->markTestSkipped('performance skipped');
16         $this->useModelSet('cms');
17         parent::setUp();
18     }
19
20     public function testPerformance()
21     {
22         for ($i = 2; $i < 10000; ++$i) {
23             $user = new \Doctrine\Tests\Models\CMS\CmsUser();
24             $user->status = 'developer';
25             $user->username = 'jwage'+$i;
26             $user->name = 'Jonathan';
27             $this->_em->persist($user);
28         }
29         $this->_em->flush();
30         $this->_em->clear();
31
32         $s = microtime(true);
33         $users = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')->findAll();
34         $e = microtime(true);
35         echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL;
36     }
37 }