From 49c735109c998555ad937fb10b781f24959cce10 Mon Sep 17 00:00:00 2001 From: kwiateusz Date: Tue, 26 Jul 2011 11:38:09 +0200 Subject: [PATCH] Change from assertType to assertInstanceOf. Now PHPUnit doesn't show warning about deprecation of assertType. Also some refractoring from assertTrue($a instanceof $b) to assertInstanceOf. Leading \ in namespaces is not required so I removed it from few assertions. --- tests/Doctrine/Tests/ORM/EntityManagerTest.php | 18 +++++++++--------- .../ORM/Functional/AdvancedAssociationTest.php | 16 ++++++++-------- .../ORM/Functional/BasicFunctionalTest.php | 16 ++++++++-------- .../ORM/Functional/CompositePrimaryKeyTest.php | 2 +- .../Tests/ORM/Functional/DefaultValuesTest.php | 2 +- .../ORM/Functional/EntityRepositoryTest.php | 12 ++++++------ .../ORM/Functional/MappedSuperclassTest.php | 4 ++-- .../OneToOneUnidirectionalAssociationTest.php | 4 ++-- .../Functional/StandardEntityPersisterTest.php | 4 ++-- .../Tests/ORM/Functional/Ticket/DDC237Test.php | 6 +++--- .../Tests/ORM/Functional/Ticket/DDC258Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC345Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC371Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC422Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC440Test.php | 4 ++-- .../Tests/ORM/Functional/Ticket/DDC501Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC633Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC729Test.php | 4 ++-- .../Tests/ORM/Functional/Ticket/DDC736Test.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC748Test.php | 4 ++-- .../Tests/ORM/Functional/Ticket/DDC837Test.php | 8 ++++---- .../Tests/ORM/Functional/Ticket/DDC949Test.php | 4 ++-- .../Tests/ORM/Mapping/ClassMetadataTest.php | 4 ++-- 23 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index ca896ad10..f54974a27 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -26,32 +26,32 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase public function testGetConnection() { - $this->assertInstanceOf('\Doctrine\DBAL\Connection', $this->_em->getConnection()); + $this->assertInstanceOf('Doctrine\DBAL\Connection', $this->_em->getConnection()); } public function testGetMetadataFactory() { - $this->assertInstanceOf('\Doctrine\ORM\Mapping\ClassMetadataFactory', $this->_em->getMetadataFactory()); + $this->assertInstanceOf('Doctrine\ORM\Mapping\ClassMetadataFactory', $this->_em->getMetadataFactory()); } public function testGetConfiguration() { - $this->assertInstanceOf('\Doctrine\ORM\Configuration', $this->_em->getConfiguration()); + $this->assertInstanceOf('Doctrine\ORM\Configuration', $this->_em->getConfiguration()); } public function testGetUnitOfWork() { - $this->assertInstanceOf('\Doctrine\ORM\UnitOfWork', $this->_em->getUnitOfWork()); + $this->assertInstanceOf('Doctrine\ORM\UnitOfWork', $this->_em->getUnitOfWork()); } public function testGetProxyFactory() { - $this->assertInstanceOf('\Doctrine\ORM\Proxy\ProxyFactory', $this->_em->getProxyFactory()); + $this->assertInstanceOf('Doctrine\ORM\Proxy\ProxyFactory', $this->_em->getProxyFactory()); } public function testGetEventManager() { - $this->assertInstanceOf('\Doctrine\Common\EventManager', $this->_em->getEventManager()); + $this->assertInstanceOf('Doctrine\Common\EventManager', $this->_em->getEventManager()); } public function testCreateNativeQuery() @@ -64,7 +64,7 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase public function testCreateQueryBuilder() { - $this->assertInstanceOf('\Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder()); + $this->assertInstanceOf('Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder()); } public function testCreateQueryBuilderAliasValid() @@ -83,7 +83,7 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase public function testCreateQuery_DqlIsOptional() { - $this->assertInstanceOf('\Doctrine\ORM\Query', $this->_em->createQuery()); + $this->assertInstanceOf('Doctrine\ORM\Query', $this->_em->createQuery()); } public function testGetPartialReference() @@ -97,7 +97,7 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase public function testCreateQuery() { $q = $this->_em->createQuery('SELECT 1'); - $this->assertInstanceOf('\Doctrine\ORM\Query', $q); + $this->assertInstanceOf('Doctrine\ORM\Query', $q); $this->assertEquals('SELECT 1', $q->getDql()); } diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php index a7c9cdc07..c4e43dfad 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php @@ -64,8 +64,8 @@ class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase $query = $this->_em->createQuery("SELECT p,t FROM Doctrine\Tests\ORM\Functional\Phrase p JOIN p.type t"); $res = $query->getResult(); $this->assertEquals(1, count($res)); - $this->assertTrue($res[0]->getType() instanceof PhraseType); - $this->assertTrue($res[0]->getType()->getPhrases() instanceof \Doctrine\ORM\PersistentCollection); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\PhraseType', $res[0]->getType()); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $res[0]->getType()->getPhrases()); $this->assertFalse($res[0]->getType()->getPhrases()->isInitialized()); $this->_em->clear(); @@ -74,8 +74,8 @@ class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase $query = $this->_em->createQuery("SELECT p,t,pp FROM Doctrine\Tests\ORM\Functional\Phrase p JOIN p.type t JOIN t.phrases pp"); $res = $query->getResult(); $this->assertEquals(1, count($res)); - $this->assertTrue($res[0]->getType() instanceof PhraseType); - $this->assertTrue($res[0]->getType()->getPhrases() instanceof \Doctrine\ORM\PersistentCollection); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\PhraseType', $res[0]->getType()); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $res[0]->getType()->getPhrases()); $this->assertTrue($res[0]->getType()->getPhrases()->isInitialized()); $this->_em->clear(); @@ -83,8 +83,8 @@ class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase // test3 - lazy-loading one-to-many after find() $phrase3 = $this->_em->find('Doctrine\Tests\ORM\Functional\Phrase', $phrase->getId()); $definitions = $phrase3->getDefinitions(); - $this->assertTrue($definitions instanceof \Doctrine\ORM\PersistentCollection); - $this->assertTrue($definitions[0] instanceof Definition); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $definitions); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Definition', $definitions[0]); $this->_em->clear(); @@ -95,7 +95,7 @@ class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->assertEquals(1, count($res)); - $this->assertTrue($definitions[0] instanceof Definition); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Definition', $definitions[0]); $this->assertEquals(2, $definitions->count()); } @@ -119,7 +119,7 @@ class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase $res = $query->getResult(); $types = $res[0]->getTypes(); - $this->assertTrue($types[0] instanceof Type); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Type', $types[0]); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php index 572b6c73d..f69b3f862 100644 --- a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php @@ -136,8 +136,8 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase ->getSingleResult(); // Address has been eager-loaded because it cant be lazy - $this->assertTrue($user2->address instanceof CmsAddress); - $this->assertFalse($user2->address instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $user2->address); + $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $user2->address); } /** @@ -276,7 +276,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->assertEquals('Guilherme', $users[0]->name); $this->assertEquals('gblanco', $users[0]->username); $this->assertEquals('developer', $users[0]->status); - $this->assertTrue($users[0]->phonenumbers instanceof \Doctrine\ORM\PersistentCollection); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $users[0]->phonenumbers); $this->assertTrue($users[0]->phonenumbers->isInitialized()); $this->assertEquals(0, $users[0]->phonenumbers->count()); //$this->assertNull($users[0]->articles); @@ -520,8 +520,8 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase $query = $this->_em->createQuery("select u, a from Doctrine\Tests\Models\CMS\CmsUser u join u.address a where u.username='gblanco'"); $gblanco = $query->getSingleResult(); - $this->assertTrue($gblanco instanceof CmsUser); - $this->assertTrue($gblanco->getAddress() instanceof CmsAddress); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $gblanco); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $gblanco->getAddress()); $this->assertEquals('Berlin', $gblanco->getAddress()->getCity()); } @@ -629,7 +629,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase $user2 = $query->getSingleResult(); $this->assertEquals(1, count($user2->articles)); - $this->assertTrue($user2->address instanceof CmsAddress); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $user2->address); $oldLogger = $this->_em->getConnection()->getConfiguration()->getSQLLogger(); $debugStack = new \Doctrine\DBAL\Logging\DebugStack; @@ -690,7 +690,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase ->setParameter('user', $userRef) ->getSingleResult(); - $this->assertTrue($address2->getUser() instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $address2->getUser()); $this->assertTrue($userRef === $address2->getUser()); $this->assertFalse($userRef->__isInitialized__); $this->assertEquals('Germany', $address2->country); @@ -905,7 +905,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->clear(); $user2 = $this->_em->find(get_class($managedUser), $userId); - $this->assertTrue($user2 instanceof CmsUser); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $user2); } public function testMergeThrowsExceptionIfEntityWithGeneratedIdentifierDoesNotExist() diff --git a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php index 7eced1b84..ee762d345 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php @@ -45,7 +45,7 @@ class CompositePrimaryKeyTest extends \Doctrine\Tests\OrmFunctionalTestCase $poi = $this->_em->find('Doctrine\Tests\Models\Navigation\NavPointOfInterest', array('lat' => 100, 'long' => 200)); - $this->assertType('Doctrine\Tests\Models\Navigation\NavPointOfInterest', $poi); + $this->assertInstanceOf('Doctrine\Tests\Models\Navigation\NavPointOfInterest', $poi); $this->assertEquals(100, $poi->getLat()); $this->assertEquals(200, $poi->getLong()); $this->assertEquals('Brandenburger Tor', $poi->getName()); diff --git a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php index 873f0d938..3da6bc09b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php @@ -50,7 +50,7 @@ class DefaultValuesTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->clear(); $a2 = $this->_em->find(get_class($a), $a->id); - $this->assertTrue($a2->getUser() instanceof DefaultValueUser); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\DefaultValueUser', $a2->getUser()); $this->assertEquals($userId, $a2->getUser()->getId()); $this->assertEquals('Poweruser', $a2->getUser()->type); } diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index 6c620db38..029d55252 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -47,7 +47,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); $user = $repos->find($user1Id); - $this->assertTrue($user instanceof CmsUser); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser',$user); $this->assertEquals('Roman', $user->name); $this->assertEquals('freak', $user->status); } @@ -59,7 +59,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $users = $repos->findBy(array('status' => 'dev')); $this->assertEquals(1, count($users)); - $this->assertTrue($users[0] instanceof CmsUser); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser',$users[0]); $this->assertEquals('Guilherme', $users[0]->name); $this->assertEquals('dev', $users[0]->status); } @@ -72,7 +72,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $users = $repos->findByStatus('dev'); $this->assertEquals(1, count($users)); - $this->assertTrue($users[0] instanceof CmsUser); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser',$users[0]); $this->assertEquals('Guilherme', $users[0]->name); $this->assertEquals('dev', $users[0]->status); } @@ -244,7 +244,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); $address = $repos->findOneBy(array('user' => $userId)); - $this->assertType('Doctrine\Tests\Models\CMS\CmsAddress', $address); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $address); $this->assertEquals($addressId, $address->id); } @@ -285,7 +285,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $repos = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsAddress'); $address = $repos->findOneByUser($userId); - $this->assertType('Doctrine\Tests\Models\CMS\CmsAddress', $address); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $address); $this->assertEquals($addressId, $address->id); } @@ -295,7 +295,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $query = $repos->createNamedQuery('all'); - $this->assertType('Doctrine\ORM\Query', $query); + $this->assertInstanceOf('Doctrine\ORM\Query', $query); $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $query->getDQL()); } diff --git a/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php b/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php index 9b1f8d607..bb324bf67 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php @@ -38,9 +38,9 @@ class MappedSuperclassTest extends \Doctrine\Tests\OrmFunctionalTestCase $cleanFile = $this->_em->find(get_class($file), $file->getId()); - $this->assertType('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()); + $this->assertInstanceOf('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()); $this->assertEquals($directory->getId(), $cleanFile->getParent()->getId()); - $this->assertType('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()->getParent()); + $this->assertInstanceOf('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()->getParent()); $this->assertEquals($root->getId(), $cleanFile->getParent()->getParent()->getId()); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php index 3adde7c10..ad4dd7404 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php @@ -56,7 +56,7 @@ class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona $result = $query->getResult(); $product = $result[0]; - $this->assertTrue($product->getShipping() instanceof ECommerceShipping); + $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceShipping', $product->getShipping()); $this->assertEquals(1, $product->getShipping()->getDays()); } @@ -69,7 +69,7 @@ class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona $result = $query->getResult(); $product = $result[0]; - $this->assertTrue($product->getShipping() instanceof ECommerceShipping); + $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceShipping', $product->getShipping()); $this->assertEquals(1, $product->getShipping()->getDays()); } diff --git a/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php index 8b37a02ba..e8132de5c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php @@ -64,7 +64,7 @@ class StandardEntityPersisterTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->flush(); $this->assertEquals(2, count($p->getFeatures())); - $this->assertTrue($p->getFeatures() instanceof \Doctrine\ORM\PersistentCollection); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $p->getFeatures()); $q = $this->_em->createQuery( 'SELECT p, f @@ -75,7 +75,7 @@ class StandardEntityPersisterTest extends \Doctrine\Tests\OrmFunctionalTestCase $res = $q->getResult(); $this->assertEquals(2, count($p->getFeatures())); - $this->assertTrue($p->getFeatures() instanceof \Doctrine\ORM\PersistentCollection); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $p->getFeatures()); // Check that the features are the same instances still foreach ($p->getFeatures() as $feature) { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php index 6dc23c895..4685f1d03 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php @@ -37,7 +37,7 @@ class DDC237Test extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->clear(); $x2 = $this->_em->find(get_class($x), $x->id); // proxy injected for Y - $this->assertTrue($x2->y instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $x2->y); $this->assertFalse($x2->y->__isInitialized__); // proxy for Y is in identity map @@ -45,7 +45,7 @@ class DDC237Test extends \Doctrine\Tests\OrmFunctionalTestCase $z2 = $this->_em->createQuery('select z,y from ' . get_class($z) . ' z join z.y y where z.id = ?1') ->setParameter(1, $z->id) ->getSingleResult(); - $this->assertTrue($z2->y instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $x2->y); $this->assertTrue($z2->y->__isInitialized__); $this->assertEquals('Y', $z2->y->data); $this->assertEquals($y->id, $z2->y->id); @@ -56,7 +56,7 @@ class DDC237Test extends \Doctrine\Tests\OrmFunctionalTestCase $this->assertNotSame($x, $x2); $this->assertNotSame($z, $z2); $this->assertSame($z2->y, $x2->y); - $this->assertTrue($z2->y instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $x2->y); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php index 29a35dada..9e92c34ce 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php @@ -44,7 +44,7 @@ class DDC258Test extends \Doctrine\Tests\OrmFunctionalTestCase $e2 = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC258Super', $c2->id); - $this->assertType('Doctrine\Tests\ORM\Functional\Ticket\DDC258Class2', $e2); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC258Class2', $e2); $this->assertEquals('Bar', $e2->title); $this->assertEquals('Bar', $e2->description); $this->assertEquals('Bar', $e2->text); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php index 63a084c87..fc2c3fc6d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php @@ -48,7 +48,7 @@ class DDC345Test extends \Doctrine\Tests\OrmFunctionalTestCase $this->assertEquals(1, $membership->prePersistCallCount); $this->assertEquals(0, $membership->preUpdateCallCount); - $this->assertTrue($membership->updated instanceof \DateTime); + $this->assertInstanceOf('DateTime', $membership->updated); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php index 399e35c34..ad1584fa0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php @@ -41,7 +41,7 @@ class DDC371Test extends \Doctrine\Tests\OrmFunctionalTestCase ->getResult(); $this->assertEquals(1, count($children)); - $this->assertFalse($children[0]->parent instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $children[0]->parent); $this->assertFalse($children[0]->parent->children->isInitialized()); $this->assertEquals(0, $children[0]->parent->children->unwrap()->count()); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php index bec65acae..ebe9f9d55 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php @@ -28,7 +28,7 @@ class DDC422Test extends \Doctrine\Tests\OrmFunctionalTestCase $customer = $this->_em->find(get_class($customer), $customer->id); - $this->assertTrue($customer->contacts instanceof \Doctrine\ORM\PersistentCollection); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $customer->contacts); $this->assertFalse($customer->contacts->isInitialized()); $contact = new DDC422Contact; $customer->contacts->add($contact); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php index a11c62407..46096fe5b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php @@ -64,13 +64,13 @@ class DDC440Test extends \Doctrine\Tests\OrmFunctionalTestCase // Test the first phone. The assertion actually failed because original entity data is not set properly. // This was because it is also set as MainPhone and that one is created as a proxy, not the // original object when the find on Client is called. However loading proxies did not work correctly. - $this->assertType('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone', $p1); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone', $p1); $originalData = $uw->getOriginalEntityData($p1); $this->assertEquals($phone->getNumber(), $originalData['number']); //If you comment out previous test, this one should pass - $this->assertType('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone', $p2); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC440Phone', $p2); $originalData = $uw->getOriginalEntityData($p2); $this->assertEquals($phone2->getNumber(), $originalData['number']); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php index 99da4c203..45c4340dc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php @@ -50,7 +50,7 @@ class DDC501Test extends OrmFunctionalTestCase // freeze and unfreeze $userClone = unserialize(serialize($userReloaded)); - $this->assertType('Doctrine\Tests\Models\CMS\CmsUser', $userClone); + $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $userClone); // detached user can't know about his phonenumbers $this->assertEquals(0, count($userClone->getPhonenumbers())); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php index d51bdd361..fa7e0af2f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php @@ -66,7 +66,7 @@ class DDC633Test extends \Doctrine\Tests\OrmFunctionalTestCase $appointments = $this->_em->createQuery("SELECT a FROM " . __NAMESPACE__ . "\DDC633Appointment a")->getResult(); foreach ($appointments AS $eagerAppointment) { - $this->assertType('Doctrine\ORM\Proxy\Proxy', $eagerAppointment->patient); + $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $eagerAppointment->patient); $this->assertTrue($eagerAppointment->patient->__isInitialized__, "Proxy should already be initialized due to eager loading!"); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php index c2be27b11..939c35d7b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php @@ -36,11 +36,11 @@ class DDC729Test extends \Doctrine\Tests\OrmFunctionalTestCase $a = new DDC729A(); $a->id = $aId; - $this->assertType('Doctrine\Common\Collections\ArrayCollection', $a->related); + $this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $a->related); $a = $this->_em->merge($a); - $this->assertType('Doctrine\ORM\PersistentCollection', $a->related); + $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $a->related); $this->assertFalse($a->related->isInitialized(), "Collection should not be marked initialized."); $this->assertFalse($a->related->isDirty(), "Collection should not be marked as dirty."); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php index 66c73bb78..de9e275bf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php @@ -72,7 +72,7 @@ class DDC736Test extends \Doctrine\Tests\OrmFunctionalTestCase /* @var $cart2 Doctrine\Tests\Models\ECommerce\ECommerceCart */ $cart2 = $result[0][0]; - $this->assertType('Doctrine\ORM\Proxy\Proxy', $cart2->getCustomer()); + $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $cart2->getCustomer()); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php index 1548552d7..9954a697b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php @@ -33,10 +33,10 @@ class DDC748Test extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($article); $this->_em->flush(); - $this->assertType('Doctrine\Common\Collections\Collection', $user->articles); + $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $user->articles); $this->_em->refresh($article); $this->assertTrue($article !== $user->articles, "The article should not be replaced on the inverse side of the relation."); - $this->assertType('Doctrine\Common\Collections\Collection', $user->articles); + $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $user->articles); } public function testRefreshOneToOne() diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php index 6afea88cd..1665b1585 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php @@ -52,20 +52,20 @@ class DDC837Test extends \Doctrine\Tests\OrmFunctionalTestCase // Test Class1 $e1 = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC837Super', $c1->id); - $this->assertType('Doctrine\Tests\ORM\Functional\Ticket\DDC837Class1', $e1); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC837Class1', $e1); $this->assertEquals('Foo', $e1->title); $this->assertEquals('Foo', $e1->description); - $this->assertType(__NAMESPACE__ . '\DDC837Aggregate', $e1->aggregate); + $this->assertInstanceOf(__NAMESPACE__ . '\DDC837Aggregate', $e1->aggregate); $this->assertEquals('test1', $e1->aggregate->getSysname()); // Test Class 2 $e2 = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC837Super', $c2->id); - $this->assertType('Doctrine\Tests\ORM\Functional\Ticket\DDC837Class2', $e2); + $this->assertInstanceOf('Doctrine\Tests\ORM\Functional\Ticket\DDC837Class2', $e2); $this->assertEquals('Bar', $e2->title); $this->assertEquals('Bar', $e2->description); $this->assertEquals('Bar', $e2->text); - $this->assertType(__NAMESPACE__ . '\DDC837Aggregate', $e2->aggregate); + $this->assertInstanceOf(__NAMESPACE__ . '\DDC837Aggregate', $e2->aggregate); $this->assertEquals('test2', $e2->aggregate->getSysname()); $all = $this->_em->getRepository(__NAMESPACE__.'\DDC837Super')->findAll(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php index adab29d93..473a8679f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php @@ -34,10 +34,10 @@ class DDC949Test extends \Doctrine\Tests\OrmFunctionalTestCase $true = $this->_em->getRepository('Doctrine\Tests\Models\Generic\BooleanModel')->findOneBy(array('booleanField' => true)); $false = $this->_em->getRepository('Doctrine\Tests\Models\Generic\BooleanModel')->findOneBy(array('booleanField' => false)); - $this->assertType('Doctrine\Tests\Models\Generic\BooleanModel', $true); + $this->assertInstanceOf('Doctrine\Tests\Models\Generic\BooleanModel', $true); $this->assertTrue($true->booleanField, "True Boolean Model should be true."); - $this->assertType('Doctrine\Tests\Models\Generic\BooleanModel', $false); + $this->assertInstanceOf('Doctrine\Tests\Models\Generic\BooleanModel', $false); $this->assertFalse($false->booleanField, "False Boolean Model should be false."); } } \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index bcf4df543..7f7d3d6cf 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -16,7 +16,7 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase // Test initial state $this->assertTrue(count($cm->getReflectionProperties()) == 0); - $this->assertTrue($cm->reflClass instanceof \ReflectionClass); + $this->assertInstanceOf('ReflectionClass', $cm->reflClass); $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name); $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->rootEntityName); $this->assertEquals(array(), $cm->subClasses); @@ -40,7 +40,7 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase // Check state $this->assertTrue(count($cm->getReflectionProperties()) > 0); $this->assertEquals('Doctrine\Tests\Models\CMS', $cm->namespace); - $this->assertTrue($cm->reflClass instanceof \ReflectionClass); + $this->assertInstanceOf('ReflectionClass', $cm->reflClass); $this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name); $this->assertEquals('UserParent', $cm->rootEntityName); $this->assertEquals(array('Doctrine\Tests\Models\CMS\One', 'Doctrine\Tests\Models\CMS\Two', 'Doctrine\Tests\Models\CMS\Three'), $cm->subClasses);