1
0
mirror of synced 2025-02-03 05:49:25 +03:00

Remove commented code that seems to not be important

This commit is contained in:
Luís Cobucci 2016-12-08 18:16:11 +01:00
parent 62d122bd54
commit ba9fecc43f
No known key found for this signature in database
GPG Key ID: 8042585A7DBC92E1
10 changed files with 0 additions and 113 deletions

View File

@ -50,7 +50,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
$this->_em->flush(); $this->_em->flush();
$this->assertTrue($this->_em->contains($ph)); $this->assertTrue($this->_em->contains($ph));
$this->assertTrue($this->_em->contains($user)); $this->assertTrue($this->_em->contains($user));
//$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $user->phonenumbers);
// Update name // Update name
$user->name = 'guilherme'; $user->name = 'guilherme';
@ -96,8 +95,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
$this->_em->persist($user); $this->_em->persist($user);
$this->_em->flush(); $this->_em->flush();
//$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $user->phonenumbers);
// Remove the first element from the collection // Remove the first element from the collection
unset($user->phonenumbers[0]); unset($user->phonenumbers[0]);
$ph1->user = null; // owning side! $ph1->user = null; // owning side!
@ -283,7 +280,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
$this->assertInstanceOf(PersistentCollection::class, $users[0]->phonenumbers); $this->assertInstanceOf(PersistentCollection::class, $users[0]->phonenumbers);
$this->assertTrue($users[0]->phonenumbers->isInitialized()); $this->assertTrue($users[0]->phonenumbers->isInitialized());
$this->assertEquals(0, $users[0]->phonenumbers->count()); $this->assertEquals(0, $users[0]->phonenumbers->count());
//$this->assertNull($users[0]->articles);
} }
public function testBasicRefresh() public function testBasicRefresh()
@ -512,9 +508,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
// that address to the user without actually loading it, using getReference(). // that address to the user without actually loading it, using getReference().
$addressRef = $this->_em->getReference(CmsAddress::class, $address->getId()); $addressRef = $this->_em->getReference(CmsAddress::class, $address->getId());
//$addressRef->getId();
//\Doctrine\Common\Util\Debug::dump($addressRef);
$user->setAddress($addressRef); // Ugh! Initializes address 'cause of $address->setUser($user)! $user->setAddress($addressRef); // Ugh! Initializes address 'cause of $address->setUser($user)!
$this->_em->flush(); $this->_em->flush();
@ -761,7 +754,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
*/ */
public function testNewAssociatedEntityDuringFlushThrowsException2() public function testNewAssociatedEntityDuringFlushThrowsException2()
{ {
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$user = new CmsUser(); $user = new CmsUser();
$user->username = "beberlei"; $user->username = "beberlei";
$user->name = "Benjamin E."; $user->name = "Benjamin E.";
@ -796,7 +788,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
*/ */
public function testNewAssociatedEntityDuringFlushThrowsException3() public function testNewAssociatedEntityDuringFlushThrowsException3()
{ {
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$art = new CmsArticle(); $art = new CmsArticle();
$art->topic = 'topic'; $art->topic = 'topic';
$art->text = 'the text'; $art->text = 'the text';
@ -954,7 +945,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
*/ */
public function testOneToOneMergeSetNull() public function testOneToOneMergeSetNull()
{ {
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$user = new CmsUser(); $user = new CmsUser();
$user->username = "beberlei"; $user->username = "beberlei";
$user->name = "Benjamin E."; $user->name = "Benjamin E.";

View File

@ -137,7 +137,6 @@ class ClassTableInheritanceTest extends OrmFunctionalTestCase
$this->assertEquals(100000, $person->getSalary()); $this->assertEquals(100000, $person->getSalary());
$this->assertEquals('CTO', $person->getTitle()); $this->assertEquals('CTO', $person->getTitle());
$this->assertTrue(is_numeric($person->getId())); $this->assertTrue(is_numeric($person->getId()));
//$this->assertInstanceOf('Doctrine\Tests\Models\Company\CompanyCar', $person->getCar());
} }
public function testSelfReferencingOneToOne() { public function testSelfReferencingOneToOne() {

View File

@ -31,8 +31,6 @@ class NotifyPolicyTest extends OrmFunctionalTestCase
public function testChangeTracking() public function testChangeTracking()
{ {
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$user = new NotifyUser(); $user = new NotifyUser();
$group = new NotifyGroup(); $group = new NotifyGroup();
$user->setName('roman'); $user->setName('roman');

View File

@ -95,28 +95,4 @@ class PersistentCollectionCriteriaTest extends OrmFunctionalTestCase
$this->assertCount(1, $tweets); $this->assertCount(1, $tweets);
$this->assertFalse($tweets->isInitialized()); $this->assertFalse($tweets->isInitialized());
} }
/*public function testCanCountWithoutLoadingManyToManyPersistentCollection()
{
$this->loadQuoteFixture();
$repository = $this->_em->getRepository('Doctrine\Tests\Models\Quote\User');
$user = $repository->findOneBy(array('name' => 'mgal'));
$groups = $user->groups->matching(new Criteria());
$this->assertInstanceOf('Doctrine\ORM\LazyManyToManyCriteriaCollection', $groups);
$this->assertFalse($groups->isInitialized());
$this->assertCount(2, $groups);
$this->assertFalse($groups->isInitialized());
// Make sure it works with constraints
$criteria = new Criteria(Criteria::expr()->eq('name', 'quote1'));
$groups = $user->groups->matching($criteria);
$this->assertInstanceOf('Doctrine\ORM\LazyManyToManyCriteriaCollection', $groups);
$this->assertFalse($groups->isInitialized());
$this->assertCount(1, $groups);
$this->assertFalse($groups->isInitialized());
}*/
} }

View File

@ -13,7 +13,6 @@ class DDC144Test extends OrmFunctionalTestCase
$this->_schemaTool->createSchema( $this->_schemaTool->createSchema(
[ [
$this->_em->getClassMetadata(DDC144FlowElement::class), $this->_em->getClassMetadata(DDC144FlowElement::class),
// $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Expression'),
$this->_em->getClassMetadata(DDC144Operand::class), $this->_em->getClassMetadata(DDC144Operand::class),
] ]
); );

View File

@ -42,13 +42,6 @@ class DDC3330Test extends OrmFunctionalTestCase
$paginator = new Paginator($query, true); $paginator = new Paginator($query, true);
/*foreach ($paginator as $building) {
echo 'BUILDING ID: '.$building->id."\n";
foreach ($building->halls as $hall) {
echo ' - HALL: '.$hall->id.' - '.$hall->name."\n";
}
}*/
$this->assertEquals(3, count(iterator_to_array($paginator)), 'Count is not correct for pagination'); $this->assertEquals(3, count(iterator_to_array($paginator)), 'Count is not correct for pagination');
} }

View File

@ -11,7 +11,6 @@ class DDC425Test extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_schemaTool->createSchema( $this->_schemaTool->createSchema(
[ [
$this->_em->getClassMetadata(DDC425Entity::class), $this->_em->getClassMetadata(DDC425Entity::class),
//$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC425Other')
] ]
); );
} }

View File

@ -31,8 +31,6 @@ class DDC522Test extends \Doctrine\Tests\OrmFunctionalTestCase
*/ */
public function testJoinColumnWithSameNameAsAssociationField() public function testJoinColumnWithSameNameAsAssociationField()
{ {
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$cust = new DDC522Customer; $cust = new DDC522Customer;
$cust->name = "name"; $cust->name = "name";
$cart = new DDC522Cart; $cart = new DDC522Cart;

View File

@ -1223,70 +1223,6 @@ class ObjectHydratorTest extends HydrationTestCase
$this->assertEquals(0, $result[1]['user']->articles->count()); $this->assertEquals(0, $result[1]['user']->articles->count());
} }
/**
* SELECT PARTIAL u.{id,status}, a.id, a.topic, c.id as cid, c.topic as ctopic
* FROM CmsUser u
* LEFT JOIN u.articles a
* LEFT JOIN a.comments c
*
* @group bubu
* @dataProvider provideDataForUserEntityResult
*/
/*public function testChainedJoinWithScalars($userEntityKey)
{
$rsm = new ResultSetMapping;
$rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsUser', 'u', $userEntityKey ?: null);
$rsm->addFieldResult('u', 'u__id', 'id');
$rsm->addFieldResult('u', 'u__status', 'status');
$rsm->addScalarResult('a__id', 'id');
$rsm->addScalarResult('a__topic', 'topic');
$rsm->addScalarResult('c__id', 'cid');
$rsm->addScalarResult('c__topic', 'ctopic');
// Faked result set
$resultSet = array(
//row1
array(
'u__id' => '1',
'u__status' => 'developer',
'a__id' => '1',
'a__topic' => 'The First',
'c__id' => '1',
'c__topic' => 'First Comment'
),
array(
'u__id' => '1',
'u__status' => 'developer',
'a__id' => '1',
'a__topic' => 'The First',
'c__id' => '2',
'c__topic' => 'Second Comment'
),
array(
'u__id' => '1',
'u__status' => 'developer',
'a__id' => '42',
'a__topic' => 'The Answer',
'c__id' => null,
'c__topic' => null
),
);
$stmt = new HydratorMockStatement($resultSet);
$hydrator = new \Doctrine\ORM\Internal\Hydration\ObjectHydrator($this->_em);
$result = $hydrator->hydrateAll($stmt, $rsm, array(Query::HINT_FORCE_PARTIAL_LOAD => true));
\Doctrine\Common\Util\Debug::dump($result, 3);
$this->assertEquals(1, count($result));
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][$userEntityKey]); // User object
$this->assertEquals(42, $result[0]['id']);
$this->assertEquals('The First', $result[0]['topic']);
$this->assertEquals(1, $result[0]['cid']);
$this->assertEquals('First Comment', $result[0]['ctopic']);
}*/
/** /**
* SELECT PARTIAL u.{id, name} * SELECT PARTIAL u.{id, name}
* FROM Doctrine\Tests\Models\CMS\CmsUser u * FROM Doctrine\Tests\Models\CMS\CmsUser u

View File

@ -127,7 +127,6 @@ class ClassMetadataTest extends OrmTestCase
); );
$assoc = $cm->associationMappings['groups']; $assoc = $cm->associationMappings['groups'];
//$this->assertInstanceOf('Doctrine\ORM\Mapping\ManyToManyMapping', $assoc);
$this->assertEquals( $this->assertEquals(
[ [
'name' => 'cmsuser_cmsgroup', 'name' => 'cmsuser_cmsgroup',