DDC1050Test.php 1010 B

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