Merge pull request #5823 from munkie/unused-code
Optimize imports. Remove full qualified class names. Remove dead code.
This commit is contained in:
commit
b3aa8254e4
@ -28,7 +28,6 @@ use Doctrine\ORM\Cache\QueryCacheKey;
|
||||
use Doctrine\DBAL\Cache\QueryCacheProfile;
|
||||
|
||||
use Doctrine\ORM\Cache;
|
||||
use Doctrine\ORM\Query\QueryException;
|
||||
|
||||
/**
|
||||
* Base contract for ORM queries. Base class for Query and NativeQuery.
|
||||
|
@ -234,7 +234,6 @@ class DefaultQueryCache implements QueryCache
|
||||
$data = array();
|
||||
$entityName = reset($rsm->aliasMap);
|
||||
$hasRelation = ( ! empty($rsm->relationMap));
|
||||
$metadata = $this->em->getClassMetadata($entityName);
|
||||
$persister = $this->uow->getEntityPersister($entityName);
|
||||
|
||||
if ( ! ($persister instanceof CachedPersister)) {
|
||||
|
@ -71,7 +71,7 @@ class EntityCacheEntry implements CacheEntry
|
||||
/**
|
||||
* Retrieves the entity data resolving cache entries
|
||||
*
|
||||
* @param \Doctrine\ORM\EntityManagerInterfac $em
|
||||
* @param \Doctrine\ORM\EntityManagerInterface $em
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
namespace Doctrine\ORM;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query\ResultSetMappingBuilder;
|
||||
use Doctrine\Common\Persistence\ObjectRepository;
|
||||
use Doctrine\Common\Collections\Selectable;
|
||||
|
@ -24,9 +24,6 @@ use PDO;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\Events;
|
||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||
use Doctrine\ORM\Event\PostLoadEventDispatcher;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Proxy\Proxy;
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
namespace Doctrine\ORM\Internal\Hydration;
|
||||
|
||||
use PDO;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Query;
|
||||
|
||||
|
@ -21,7 +21,6 @@ namespace Doctrine\ORM\Persisters\Collection;
|
||||
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Persisters\SqlExpressionVisitor;
|
||||
use Doctrine\ORM\Persisters\SqlValueVisitor;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\ORM\Query;
|
||||
@ -740,7 +739,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
||||
|
||||
$valueVisitor->dispatch($expression);
|
||||
|
||||
list($values, $types) = $valueVisitor->getParamsAndTypes();
|
||||
list(, $types) = $valueVisitor->getParamsAndTypes();
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
namespace Doctrine\ORM\Persisters\Collection;
|
||||
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Common\Proxy\Proxy;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\ORM\Utility\PersisterHelper;
|
||||
|
@ -20,7 +20,6 @@
|
||||
namespace Doctrine\ORM\Persisters\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
|
@ -2953,7 +2953,7 @@ class Parser
|
||||
/**
|
||||
* EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
|
||||
*
|
||||
* @return \Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression |
|
||||
* @return \Doctrine\ORM\Query\AST\PathExpression |
|
||||
* \Doctrine\ORM\Query\AST\SimpleEntityExpression
|
||||
*/
|
||||
public function EntityExpression()
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
namespace Doctrine\ORM\Query;
|
||||
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
use Doctrine\ORM\Mapping\MappingException;
|
||||
|
@ -18,18 +18,9 @@ use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLAnywherePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLServerPlatform;
|
||||
use Doctrine\ORM\Query\AST\ArithmeticExpression;
|
||||
use Doctrine\ORM\Query\AST\ArithmeticFactor;
|
||||
use Doctrine\ORM\Query\AST\ArithmeticTerm;
|
||||
use Doctrine\ORM\Query\AST\Literal;
|
||||
use Doctrine\ORM\Query\AST\OrderByClause;
|
||||
use Doctrine\ORM\Query\AST\OrderByItem;
|
||||
use Doctrine\ORM\Query\AST\PartialObjectExpression;
|
||||
use Doctrine\ORM\Query\AST\PathExpression;
|
||||
use Doctrine\ORM\Query\AST\SelectExpression;
|
||||
use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
|
||||
use Doctrine\ORM\Query\Expr\OrderBy;
|
||||
use Doctrine\ORM\Query\Expr\Select;
|
||||
use Doctrine\ORM\Query\SqlWalker;
|
||||
use Doctrine\ORM\Query\AST\SelectStatement;
|
||||
|
||||
|
@ -20,7 +20,6 @@ namespace Doctrine\ORM\Tools\Pagination;
|
||||
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\Query\TreeWalkerAdapter;
|
||||
use Doctrine\ORM\Query\AST\Functions\IdentityFunction;
|
||||
|
@ -49,7 +49,6 @@ use Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister;
|
||||
use Doctrine\ORM\Persisters\Collection\OneToManyPersister;
|
||||
use Doctrine\ORM\Persisters\Collection\ManyToManyPersister;
|
||||
use Doctrine\ORM\Utility\IdentifierFlattener;
|
||||
use Doctrine\ORM\Cache\AssociationCacheEntry;
|
||||
|
||||
/**
|
||||
* The UnitOfWork is responsible for tracking changes to objects during an
|
||||
@ -1281,7 +1280,7 @@ class UnitOfWork implements PropertyChangedListener
|
||||
$extraUpdate = array($entity, $changeset);
|
||||
|
||||
if (isset($this->extraUpdates[$oid])) {
|
||||
list($ignored, $changeset2) = $this->extraUpdates[$oid];
|
||||
list(, $changeset2) = $this->extraUpdates[$oid];
|
||||
|
||||
$extraUpdate = array($entity, $changeset + $changeset2);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class CacheMetadataListener
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isVisited(ClassMetaData $metadata)
|
||||
private function isVisited(ClassMetadata $metadata)
|
||||
{
|
||||
return isset($this->enabledItems[$metadata->getName()]);
|
||||
}
|
||||
@ -48,7 +48,7 @@ class CacheMetadataListener
|
||||
/**
|
||||
* @param ClassMetadata $metadata
|
||||
*/
|
||||
private function recordVisit(ClassMetaData $metadata)
|
||||
private function recordVisit(ClassMetadata $metadata)
|
||||
{
|
||||
$this->enabledItems[$metadata->getName()] = true;
|
||||
}
|
||||
|
@ -2,10 +2,12 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
|
||||
/**
|
||||
* Mock class for ClassMetadata.
|
||||
*/
|
||||
class ClassMetadataMock extends \Doctrine\ORM\Mapping\ClassMetadata
|
||||
class ClassMetadataMock extends ClassMetadata
|
||||
{
|
||||
/* Mock API */
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
use Doctrine\DBAL\Connection;
|
||||
|
||||
/**
|
||||
* Mock class for Connection.
|
||||
*/
|
||||
class ConnectionMock extends \Doctrine\DBAL\Connection
|
||||
class ConnectionMock extends Connection
|
||||
{
|
||||
/**
|
||||
* @var mixed
|
||||
|
@ -2,10 +2,12 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
/**
|
||||
* Mock class for DatabasePlatform.
|
||||
*/
|
||||
class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
|
||||
class DatabasePlatformMock extends AbstractPlatform
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
|
@ -2,10 +2,12 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Driver\Connection;
|
||||
|
||||
/**
|
||||
* Mock class for DriverConnection.
|
||||
*/
|
||||
class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection
|
||||
class DriverConnectionMock implements Connection
|
||||
{
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Driver\Statement
|
||||
|
@ -2,10 +2,15 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Schema\AbstractSchemaManager;
|
||||
|
||||
/**
|
||||
* Mock class for Driver.
|
||||
*/
|
||||
class DriverMock implements \Doctrine\DBAL\Driver
|
||||
class DriverMock implements Driver
|
||||
{
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Platforms\AbstractPlatform|null
|
||||
@ -39,7 +44,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
|
||||
public function getSchemaManager(Connection $conn)
|
||||
{
|
||||
if ($this->_schemaManagerMock == null) {
|
||||
return new SchemaManagerMock($conn);
|
||||
@ -55,7 +60,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $platform)
|
||||
public function setDatabasePlatform(AbstractPlatform $platform)
|
||||
{
|
||||
$this->_platformMock = $platform;
|
||||
}
|
||||
@ -65,7 +70,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm)
|
||||
public function setSchemaManager(AbstractSchemaManager $sm)
|
||||
{
|
||||
$this->_schemaManagerMock = $sm;
|
||||
}
|
||||
@ -81,7 +86,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDatabase(\Doctrine\DBAL\Connection $conn)
|
||||
public function getDatabase(Connection $conn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -21,12 +21,14 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\Proxy\ProxyFactory;
|
||||
use Doctrine\Common\EventManager;
|
||||
use Doctrine\ORM\Configuration;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
/**
|
||||
* Special EntityManager mock used for testing purposes.
|
||||
*/
|
||||
class EntityManagerMock extends \Doctrine\ORM\EntityManager
|
||||
class EntityManagerMock extends EntityManager
|
||||
{
|
||||
/**
|
||||
* @var \Doctrine\ORM\UnitOfWork|null
|
||||
@ -83,17 +85,16 @@ class EntityManagerMock extends \Doctrine\ORM\EntityManager
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create($conn, \Doctrine\ORM\Configuration $config = null,
|
||||
\Doctrine\Common\EventManager $eventManager = null)
|
||||
public static function create($conn, Configuration $config = null, EventManager $eventManager = null)
|
||||
{
|
||||
if (null === $config) {
|
||||
$config = new \Doctrine\ORM\Configuration();
|
||||
$config = new Configuration();
|
||||
$config->setProxyDir(__DIR__ . '/../Proxies');
|
||||
$config->setProxyNamespace('Doctrine\Tests\Proxies');
|
||||
$config->setMetadataDriverImpl($config->newDefaultAnnotationDriver(array(), true));
|
||||
}
|
||||
if (null === $eventManager) {
|
||||
$eventManager = new \Doctrine\Common\EventManager();
|
||||
$eventManager = new EventManager();
|
||||
}
|
||||
|
||||
return new EntityManagerMock($conn, $config, $eventManager);
|
||||
|
@ -3,11 +3,13 @@
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Persisters\Entity\BasicEntityPersister;
|
||||
|
||||
/**
|
||||
* EntityPersister implementation used for mocking during tests.
|
||||
*/
|
||||
class EntityPersisterMock extends \Doctrine\ORM\Persisters\Entity\BasicEntityPersister
|
||||
class EntityPersisterMock extends BasicEntityPersister
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
@ -52,7 +54,7 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\Entity\BasicEntityPer
|
||||
public function addInsert($entity)
|
||||
{
|
||||
$this->inserts[] = $entity;
|
||||
if ( ! is_null($this->mockIdGeneratorType) && $this->mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY
|
||||
if ( ! is_null($this->mockIdGeneratorType) && $this->mockIdGeneratorType == ClassMetadata::GENERATOR_TYPE_IDENTITY
|
||||
|| $this->class->isIdGeneratorIdentity()) {
|
||||
$id = $this->identityColumnValueCounter++;
|
||||
$this->postInsertIds[] = array(
|
||||
|
@ -2,13 +2,15 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Driver\Statement;
|
||||
|
||||
/**
|
||||
* This class is a mock of the Statement interface that can be passed in to the Hydrator
|
||||
* to test the hydration standalone with faked result sets.
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
|
||||
class HydratorMockStatement implements \IteratorAggregate, Statement
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
|
@ -2,15 +2,18 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
|
||||
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
||||
|
||||
/**
|
||||
* Mock class for MappingDriver.
|
||||
*/
|
||||
class MetadataDriverMock implements \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
|
||||
class MetadataDriverMock implements MappingDriver
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function loadMetadataForClass($className, \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata)
|
||||
public function loadMetadataForClass($className, ClassMetadata $metadata)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -2,10 +2,12 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\Query\TreeWalkerAdapter;
|
||||
|
||||
/**
|
||||
* Mock class for TreeWalker.
|
||||
*/
|
||||
class MockTreeWalker extends \Doctrine\ORM\Query\TreeWalkerAdapter
|
||||
class MockTreeWalker extends TreeWalkerAdapter
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -2,15 +2,18 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Schema\AbstractSchemaManager;
|
||||
|
||||
/**
|
||||
* Mock class for AbstractSchemaManager.
|
||||
*/
|
||||
class SchemaManagerMock extends \Doctrine\DBAL\Schema\AbstractSchemaManager
|
||||
class SchemaManagerMock extends AbstractSchemaManager
|
||||
{
|
||||
/**
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct(\Doctrine\DBAL\Connection $conn)
|
||||
public function __construct(Connection $conn)
|
||||
{
|
||||
parent::__construct($conn);
|
||||
}
|
||||
|
@ -3,11 +3,12 @@
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\Id\SequenceGenerator;
|
||||
|
||||
/**
|
||||
* Mock class for SequenceGenerator.
|
||||
*/
|
||||
class SequenceMock extends \Doctrine\ORM\Id\SequenceGenerator
|
||||
class SequenceMock extends SequenceGenerator
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
|
@ -2,12 +2,14 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Driver\Statement;
|
||||
|
||||
/**
|
||||
* This class is a mock of the Statement interface.
|
||||
*
|
||||
* @author Alexander <iam.asm89@gmail.com>
|
||||
*/
|
||||
class StatementMock implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
|
||||
class StatementMock implements \IteratorAggregate, Statement
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -2,10 +2,12 @@
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
|
||||
/**
|
||||
* Mock class for UnitOfWork.
|
||||
*/
|
||||
class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork
|
||||
class UnitOfWorkMock extends UnitOfWork
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
|
@ -20,7 +20,7 @@ class DDC2504RootClass
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @var Doctrine\Tests\Models\DDC\DDC2504OtherClass
|
||||
* @var \Doctrine\Tests\Models\DDC2504\DDC2504OtherClass
|
||||
*
|
||||
* @ManyToOne(targetEntity="DDC2504OtherClass", inversedBy="childClasses")
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@ class DDC3293User
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @var Doctrine\Tests\Models\DDC3293\DDC3293Address
|
||||
* @var \Doctrine\Tests\Models\DDC3293\DDC3293Address
|
||||
*/
|
||||
protected $address;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class DDC3293UserPrefixed
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @var Doctrine\Tests\Models\DDC3293\DDC3293Address
|
||||
* @var \Doctrine\Tests\Models\DDC3293\DDC3293Address
|
||||
*/
|
||||
protected $address;
|
||||
}
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC3579;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @AssociationOverrides({
|
||||
|
@ -20,8 +20,6 @@
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC753;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class DDC753InvalidRepository
|
||||
{
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC964;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @AssociationOverrides({
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC964;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @AttributeOverrides({
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\Models\Legacy;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="legacy_cars")
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
namespace Doctrine\Tests\Models\StockExchange;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
namespace Doctrine\Tests\Models\StockExchange;
|
||||
|
||||
/**
|
||||
* Bonds have many stocks. This uses a many to many association and fails to model how many of a
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\Models\StockExchange;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="exchange_stocks")
|
||||
|
@ -4,11 +4,12 @@ namespace Doctrine\Tests\ORM\Cache;
|
||||
|
||||
use Doctrine\ORM\Cache\EntityCacheKey;
|
||||
use Doctrine\ORM\Cache\CollectionCacheKey;
|
||||
use Doctrine\Tests\DoctrineTestCase;
|
||||
|
||||
/**
|
||||
* @group DDC-2183
|
||||
*/
|
||||
class CacheKeyTest extends \Doctrine\Tests\DoctrineTestCase
|
||||
class CacheKeyTest extends DoctrineTestCase
|
||||
{
|
||||
public function testEntityCacheKeyIdentifierCollision()
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Cache;
|
||||
|
||||
use Doctrine\Tests\Mocks\TimestampRegionMock;
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
use Doctrine\Tests\Mocks\CacheRegionMock;
|
||||
use Doctrine\ORM\Cache\DefaultQueryCache;
|
||||
@ -11,7 +12,6 @@ use Doctrine\ORM\Query\ResultSetMappingBuilder;
|
||||
use Doctrine\Tests\Models\Cache\Country;
|
||||
use Doctrine\Tests\Models\Cache\City;
|
||||
use Doctrine\Tests\Models\Cache\State;
|
||||
use Doctrine\Tests\Models\Cache\Travel;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Tests\Models\Generic\BooleanModel;
|
||||
use Doctrine\ORM\Cache\EntityCacheEntry;
|
||||
@ -542,7 +542,7 @@ class DefaultQueryCacheTest extends OrmTestCase
|
||||
|
||||
}
|
||||
|
||||
class CacheFactoryDefaultQueryCacheTest extends \Doctrine\ORM\Cache\DefaultCacheFactory
|
||||
class CacheFactoryDefaultQueryCacheTest extends Cache\DefaultCacheFactory
|
||||
{
|
||||
private $queryCache;
|
||||
private $region;
|
||||
@ -565,6 +565,6 @@ class CacheFactoryDefaultQueryCacheTest extends \Doctrine\ORM\Cache\DefaultCache
|
||||
|
||||
public function getTimestampRegion()
|
||||
{
|
||||
return new \Doctrine\Tests\Mocks\TimestampRegionMock();
|
||||
return new TimestampRegionMock();
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Cache;
|
||||
|
||||
use Doctrine\Common\Cache\ApcCache;
|
||||
use Doctrine\Common\Cache\ArrayCache;
|
||||
use Doctrine\ORM\Cache\CollectionCacheEntry;
|
||||
use Doctrine\ORM\Cache\Region\DefaultRegion;
|
||||
@ -32,8 +33,8 @@ class DefaultRegionTest extends AbstractRegionTest
|
||||
|
||||
$key = new CacheKeyMock('key');
|
||||
$entry = new CacheEntryMock(array('value' => 'foo'));
|
||||
$region1 = new DefaultRegion('region1', new \Doctrine\Common\Cache\ApcCache());
|
||||
$region2 = new DefaultRegion('region2', new \Doctrine\Common\Cache\ApcCache());
|
||||
$region1 = new DefaultRegion('region1', new ApcCache());
|
||||
$region2 = new DefaultRegion('region2', new ApcCache());
|
||||
|
||||
$this->assertFalse($region1->contains($key));
|
||||
$this->assertFalse($region2->contains($key));
|
||||
|
@ -2,12 +2,10 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Cache;
|
||||
|
||||
use Doctrine\Common\Cache\ArrayCache;
|
||||
use Doctrine\Tests\Mocks\CacheEntryMock;
|
||||
use Doctrine\Tests\Mocks\CacheKeyMock;
|
||||
use Doctrine\ORM\Cache\Region\DefaultMultiGetRegion;
|
||||
use Doctrine\ORM\Cache\CollectionCacheEntry;
|
||||
use Doctrine\ORM\Cache\EntityCacheKey;
|
||||
|
||||
/**
|
||||
* @author Asmir Mustafic <goetas@gmail.com>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Cache\Persister\Collection;
|
||||
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
|
||||
use Doctrine\ORM\Cache\Region;
|
||||
@ -101,7 +102,7 @@ abstract class AbstractCollectionPersisterTest extends OrmTestCase
|
||||
$em = $this->em;
|
||||
$class = $class ?: $this->em->getClassMetadata('Doctrine\Tests\Models\Cache\State');
|
||||
$assoc = $assoc ?: $class->associationMappings['cities'];
|
||||
$coll = new \Doctrine\ORM\PersistentCollection($em, $class, $elements ?: new ArrayCollection);
|
||||
$coll = new PersistentCollection($em, $class, $elements ?: new ArrayCollection);
|
||||
|
||||
$coll->setOwner($owner, $assoc);
|
||||
$coll->setInitialized(true);
|
||||
|
@ -4,6 +4,7 @@ namespace Doctrine\Tests\ORM;
|
||||
|
||||
use Doctrine\ORM\Internal\CommitOrderCalculator;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
|
||||
/**
|
||||
* Tests of the commit order calculation.
|
||||
@ -12,7 +13,7 @@ use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
* can have many valid orderings, so you may want to build a graph that has only
|
||||
* 1 valid order to simplify your tests.
|
||||
*/
|
||||
class CommitOrderCalculatorTest extends \Doctrine\Tests\OrmTestCase
|
||||
class CommitOrderCalculatorTest extends OrmTestCase
|
||||
{
|
||||
private $_calc;
|
||||
|
||||
|
@ -6,7 +6,6 @@ use Doctrine\Common\Proxy\AbstractProxyFactory;
|
||||
use Doctrine\Common\Cache\ArrayCache;
|
||||
use Doctrine\ORM\Mapping as AnnotationNamespace;
|
||||
use Doctrine\ORM\Configuration;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use ReflectionClass;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Decorator;
|
||||
|
||||
use Doctrine\ORM\Decorator\EntityManagerDecorator;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
|
||||
class EntityManagerDecoratorTest extends \PHPUnit_Framework_TestCase
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Entity;
|
||||
|
||||
class ConstructorTest extends \Doctrine\Tests\OrmTestCase
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
|
||||
class ConstructorTest extends OrmTestCase
|
||||
{
|
||||
public function testFieldInitializationInConstructor()
|
||||
{
|
||||
|
@ -2,7 +2,10 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM;
|
||||
|
||||
class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
|
||||
class EntityManagerTest extends OrmTestCase
|
||||
{
|
||||
private $_em;
|
||||
|
||||
@ -54,7 +57,7 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
|
||||
|
||||
public function testCreateNativeQuery()
|
||||
{
|
||||
$rsm = new \Doctrine\ORM\Query\ResultSetMapping();
|
||||
$rsm = new ResultSetMapping();
|
||||
$query = $this->_em->createNativeQuery('SELECT foo', $rsm);
|
||||
|
||||
$this->assertSame('SELECT foo', $query->getSql());
|
||||
@ -65,7 +68,7 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
|
||||
*/
|
||||
public function testCreateNamedNativeQuery()
|
||||
{
|
||||
$rsm = new \Doctrine\ORM\Query\ResultSetMapping();
|
||||
$rsm = new ResultSetMapping();
|
||||
$this->_em->getConfiguration()->addNamedNativeQuery('foo', 'SELECT foo', $rsm);
|
||||
|
||||
$query = $this->_em->createNamedNativeQuery('foo');
|
||||
|
@ -3,11 +3,12 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Base class for testing a many-to-many association mapping (without inheritance).
|
||||
*/
|
||||
class AbstractManyToManyAssociationTestCase extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class AbstractManyToManyAssociationTestCase extends OrmFunctionalTestCase
|
||||
{
|
||||
protected $_firstField;
|
||||
protected $_secondField;
|
||||
|
@ -2,14 +2,16 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Functional tests for the Single Table Inheritance mapping strategy.
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class AdvancedAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
@ -151,7 +153,7 @@ class Lemma {
|
||||
private $types;
|
||||
|
||||
public function __construct() {
|
||||
$this->types = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->types = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
||||
@ -257,7 +259,7 @@ class Type {
|
||||
private $lemmas;
|
||||
|
||||
public function __construct(){
|
||||
$this->lemmas = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->lemmas = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -372,7 +374,7 @@ class Phrase {
|
||||
private $definitions;
|
||||
|
||||
public function __construct() {
|
||||
$this->definitions = new \Doctrine\Common\Collections\ArrayCollection;
|
||||
$this->definitions = new ArrayCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -464,7 +466,7 @@ class PhraseType {
|
||||
private $phrases;
|
||||
|
||||
public function __construct() {
|
||||
$this->phrases = new \Doctrine\Common\Collections\ArrayCollection;
|
||||
$this->phrases = new ArrayCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,15 +4,15 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\Company\CompanyEmployee,
|
||||
Doctrine\Tests\Models\Company\CompanyManager,
|
||||
Doctrine\Tests\Models\Company\CompanyPerson,
|
||||
Doctrine\Tests\Models\Company\CompanyCar;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Functional Query tests.
|
||||
*
|
||||
* @author Benjamin <kontakt@beberlei.de>
|
||||
*/
|
||||
class AdvancedDqlQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class AdvancedDqlQueryTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -2,16 +2,19 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\Tools\SchemaTool;
|
||||
use Doctrine\DBAL\Logging\DebugStack;
|
||||
use Doctrine\ORM\EntityNotFoundException;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsGroup;
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle;
|
||||
use Doctrine\Tests\Models\CMS\CmsComment;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class BasicFunctionalTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
@ -67,9 +70,9 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($user));
|
||||
$this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($ph));
|
||||
$this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($ph2));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph2));
|
||||
$this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user));
|
||||
$this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph));
|
||||
$this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph2));
|
||||
}
|
||||
|
||||
public function testOneToManyAssociationModification()
|
||||
@ -148,15 +151,15 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$user->username = 'gblanco';
|
||||
$user->status = 'developer';
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW");
|
||||
$this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW");
|
||||
|
||||
$this->_em->persist($user);
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_MANAGED");
|
||||
$this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_MANAGED");
|
||||
|
||||
$this->_em->remove($user);
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW");
|
||||
$this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW");
|
||||
|
||||
$this->_em->persist($user);
|
||||
$this->_em->flush();
|
||||
@ -164,10 +167,10 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
|
||||
$this->_em->remove($user);
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_REMOVED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_REMOVED");
|
||||
$this->assertEquals(UnitOfWork::STATE_REMOVED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_REMOVED");
|
||||
$this->_em->flush();
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW");
|
||||
$this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW");
|
||||
|
||||
$this->assertNull($this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $id));
|
||||
}
|
||||
@ -567,7 +570,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
|
||||
$this->_em->persist($user);
|
||||
|
||||
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article = new CmsArticle();
|
||||
$article->text = "Lorem ipsum dolor sunt.";
|
||||
$article->topic = "A Test Article!";
|
||||
$article->setAuthor($user);
|
||||
@ -610,7 +613,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$address->user = $user;
|
||||
$user->address = $address;
|
||||
|
||||
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article = new CmsArticle();
|
||||
$article->text = "Lorem ipsum dolor sunt.";
|
||||
$article->topic = "A Test Article!";
|
||||
$article->setAuthor($user);
|
||||
@ -630,7 +633,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $user2->address);
|
||||
|
||||
$oldLogger = $this->_em->getConnection()->getConfiguration()->getSQLLogger();
|
||||
$debugStack = new \Doctrine\DBAL\Logging\DebugStack;
|
||||
$debugStack = new DebugStack();
|
||||
$this->_em->getConnection()->getConfiguration()->setSQLLogger($debugStack);
|
||||
|
||||
$this->_em->flush();
|
||||
@ -940,7 +943,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
try {
|
||||
$this->_em->merge($user);
|
||||
$this->fail();
|
||||
} catch (\Doctrine\ORM\EntityNotFoundException $enfe) {}
|
||||
} catch (EntityNotFoundException $enfe) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -997,7 +1000,7 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.id = ?1";
|
||||
$article = $this->_em->createQuery($dql)
|
||||
->setParameter(1, $article->id)
|
||||
->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', \Doctrine\ORM\Mapping\ClassMetadata::FETCH_EAGER)
|
||||
->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', ClassMetadata::FETCH_EAGER)
|
||||
->getSingleResult();
|
||||
$this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $article->user, "It IS a proxy, ...");
|
||||
$this->assertTrue($article->user->__isInitialized__, "...but its initialized!");
|
||||
@ -1043,14 +1046,14 @@ class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
|
||||
$this->_em->clear('Doctrine\Tests\Models\CMS\CmsUser');
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($user));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article1));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article2));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($address));
|
||||
$this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($user));
|
||||
$this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article1));
|
||||
$this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article2));
|
||||
$this->assertEquals(UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($address));
|
||||
|
||||
$this->_em->clear();
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($address));
|
||||
$this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($address));
|
||||
}
|
||||
|
||||
public function testFlushManyExplicitEntities()
|
||||
|
@ -3,11 +3,12 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group CascadeRemoveOrderTest
|
||||
*/
|
||||
class CascadeRemoveOrderTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class CascadeRemoveOrderTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -6,21 +6,21 @@ use Doctrine\Tests\Models\Company\CompanyPerson,
|
||||
Doctrine\Tests\Models\Company\CompanyEmployee,
|
||||
Doctrine\Tests\Models\Company\CompanyManager,
|
||||
Doctrine\Tests\Models\Company\CompanyOrganization,
|
||||
Doctrine\Tests\Models\Company\CompanyEvent,
|
||||
Doctrine\Tests\Models\Company\CompanyAuction,
|
||||
Doctrine\Tests\Models\Company\CompanyRaffle,
|
||||
Doctrine\Tests\Models\Company\CompanyCar;
|
||||
Doctrine\Tests\Models\Company\CompanyRaffle;
|
||||
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Functional tests for the Class Table Inheritance mapping strategy.
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class ClassTableInheritanceTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('company');
|
||||
parent::setUp();
|
||||
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
|
||||
@ -82,7 +82,7 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$query->setParameter(1, 'NewName', 'string');
|
||||
$query->setParameter(2, 'NewDepartment');
|
||||
$query->setParameter(3, 100000);
|
||||
$query->getSql();
|
||||
$query->getSQL();
|
||||
$numUpdated = $query->execute();
|
||||
$this->assertEquals(1, $numUpdated);
|
||||
|
||||
|
@ -1,15 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Functional tests for the Class Table Inheritance mapping strategy.
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class ClassTableInheritanceTest2 extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class ClassTableInheritanceTest2 extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
try {
|
||||
$this->_schemaTool->createSchema(array(
|
||||
@ -156,19 +159,23 @@ class CTIRelated2
|
||||
private $ctiChildren;
|
||||
|
||||
|
||||
public function __construct() {
|
||||
$this->ctiChildren = new \Doctrine\Common\Collections\ArrayCollection;
|
||||
public function __construct()
|
||||
{
|
||||
$this->ctiChildren = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function addCTIChild(CTIChild $child) {
|
||||
public function addCTIChild(CTIChild $child)
|
||||
{
|
||||
$this->ctiChildren->add($child);
|
||||
}
|
||||
|
||||
public function getCTIChildren() {
|
||||
public function getCTIChildren()
|
||||
{
|
||||
return $this->ctiChildren;
|
||||
}
|
||||
}
|
||||
|
@ -4,18 +4,15 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\Event\OnClearEventArgs;
|
||||
use Doctrine\ORM\Events;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* ClearEventTest
|
||||
*
|
||||
* @author Michael Ridgway <mcridgway@gmail.com>
|
||||
*/
|
||||
class ClearEventTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class ClearEventTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function testEventIsCalledOnClear()
|
||||
{
|
||||
$listener = new OnClearListener;
|
||||
|
@ -6,8 +6,9 @@ use Doctrine\Tests\Models\Navigation\NavPointOfInterest;
|
||||
use Doctrine\Tests\Models\Navigation\NavTour;
|
||||
use Doctrine\Tests\Models\Navigation\NavPhotos;
|
||||
use Doctrine\Tests\Models\Navigation\NavUser;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class CompositePrimaryKeyTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class CompositePrimaryKeyTest extends OrmFunctionalTestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\GeoNames\Country;
|
||||
use Doctrine\Tests\Models\GeoNames\Admin1;
|
||||
use Doctrine\Tests\Models\GeoNames\Admin1AlternateName;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class CompositePrimaryKeyWithAssociationsTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class CompositePrimaryKeyWithAssociationsTest extends OrmFunctionalTestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SQLServerPlatform;
|
||||
use Doctrine\DBAL\Schema\Table;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
|
||||
|
||||
@ -30,10 +31,10 @@ class DatabaseDriverTest extends DatabaseDriverTestCase
|
||||
$this->markTestSkipped('Platform does not support foreign keys.');
|
||||
}
|
||||
|
||||
$user = new \Doctrine\DBAL\Schema\Table("ddc2059_user");
|
||||
$user = new Table("ddc2059_user");
|
||||
$user->addColumn('id', 'integer');
|
||||
$user->setPrimaryKey(array('id'));
|
||||
$project = new \Doctrine\DBAL\Schema\Table("ddc2059_project");
|
||||
$project = new Table("ddc2059_project");
|
||||
$project->addColumn('id', 'integer');
|
||||
$project->addColumn('user_id', 'integer');
|
||||
$project->addColumn('user', 'string');
|
||||
@ -52,7 +53,7 @@ class DatabaseDriverTest extends DatabaseDriverTestCase
|
||||
$this->markTestSkipped('Platform does not support foreign keys.');
|
||||
}
|
||||
|
||||
$table = new \Doctrine\DBAL\Schema\Table("dbdriver_foo");
|
||||
$table = new Table("dbdriver_foo");
|
||||
$table->addColumn('id', 'integer');
|
||||
$table->setPrimaryKey(array('id'));
|
||||
$table->addColumn('bar', 'string', array('notnull' => false, 'length' => 200));
|
||||
@ -83,13 +84,13 @@ class DatabaseDriverTest extends DatabaseDriverTestCase
|
||||
$this->markTestSkipped('Platform does not support foreign keys.');
|
||||
}
|
||||
|
||||
$tableB = new \Doctrine\DBAL\Schema\Table("dbdriver_bar");
|
||||
$tableB = new Table("dbdriver_bar");
|
||||
$tableB->addColumn('id', 'integer');
|
||||
$tableB->setPrimaryKey(array('id'));
|
||||
|
||||
$this->_sm->dropAndCreateTable($tableB);
|
||||
|
||||
$tableA = new \Doctrine\DBAL\Schema\Table("dbdriver_baz");
|
||||
$tableA = new Table("dbdriver_baz");
|
||||
$tableA->addColumn('id', 'integer');
|
||||
$tableA->setPrimaryKey(array('id'));
|
||||
$tableA->addColumn('bar_id', 'integer');
|
||||
@ -133,15 +134,15 @@ class DatabaseDriverTest extends DatabaseDriverTestCase
|
||||
|
||||
public function testIgnoreManyToManyTableWithoutFurtherForeignKeyDetails()
|
||||
{
|
||||
$tableB = new \Doctrine\DBAL\Schema\Table("dbdriver_bar");
|
||||
$tableB = new Table("dbdriver_bar");
|
||||
$tableB->addColumn('id', 'integer');
|
||||
$tableB->setPrimaryKey(array('id'));
|
||||
|
||||
$tableA = new \Doctrine\DBAL\Schema\Table("dbdriver_baz");
|
||||
$tableA = new Table("dbdriver_baz");
|
||||
$tableA->addColumn('id', 'integer');
|
||||
$tableA->setPrimaryKey(array('id'));
|
||||
|
||||
$tableMany = new \Doctrine\DBAL\Schema\Table("dbdriver_bar_baz");
|
||||
$tableMany = new Table("dbdriver_bar_baz");
|
||||
$tableMany->addColumn('bar_id', 'integer');
|
||||
$tableMany->addColumn('baz_id', 'integer');
|
||||
$tableMany->addForeignKeyConstraint('dbdriver_bar', array('bar_id'), array('id'));
|
||||
@ -157,7 +158,7 @@ class DatabaseDriverTest extends DatabaseDriverTestCase
|
||||
$this->markTestSkipped('Platform does not support foreign keys.');
|
||||
}
|
||||
|
||||
$table = new \Doctrine\DBAL\Schema\Table("dbdriver_foo");
|
||||
$table = new Table("dbdriver_foo");
|
||||
|
||||
$table->addColumn('id', 'integer', array('unsigned' => true));
|
||||
$table->setPrimaryKey(array('id'));
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\Mapping\Driver\DatabaseDriver;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
|
||||
@ -13,7 +14,7 @@ abstract class DatabaseDriverTestCase extends OrmFunctionalTestCase
|
||||
protected function convertToClassMetadata(array $entityTables, array $manyTables = array())
|
||||
{
|
||||
$sm = $this->_em->getConnection()->getSchemaManager();
|
||||
$driver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($sm);
|
||||
$driver = new DatabaseDriver($sm);
|
||||
$driver->setTables($entityTables, $manyTables);
|
||||
|
||||
$metadatas = array();
|
||||
@ -36,7 +37,7 @@ abstract class DatabaseDriverTestCase extends OrmFunctionalTestCase
|
||||
$metadatas = array();
|
||||
|
||||
$sm = $this->_em->getConnection()->getSchemaManager();
|
||||
$driver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($sm);
|
||||
$driver = new DatabaseDriver($sm);
|
||||
|
||||
foreach ($driver->getAllClassNames() as $className) {
|
||||
if (!in_array(strtolower($className), $classNames)) {
|
||||
|
@ -1,15 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests basic operations on entities with default values.
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class DefaultValuesTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class DefaultValuesTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
try {
|
||||
$this->_schemaTool->createSchema(array(
|
||||
|
@ -6,16 +6,17 @@ use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle;
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Description of DetachedEntityTest
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class DetachedEntityTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class DetachedEntityTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('cms');
|
||||
parent::setUp();
|
||||
}
|
||||
|
@ -3,11 +3,12 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\Company\CompanyFixContract;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group DDC-1955
|
||||
*/
|
||||
class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class EntityListenersTest extends OrmFunctionalTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -23,11 +23,12 @@ use Doctrine\Tests\Models\Generic\DateTimeModel;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Tests\Models\Tweet\Tweet;
|
||||
use Doctrine\Tests\Models\Tweet\User;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Josiah <josiah@jjs.id.au>
|
||||
*/
|
||||
class EntityRepositoryCriteriaTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class EntityRepositoryCriteriaTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -2,19 +2,22 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsEmail;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author robo
|
||||
*/
|
||||
class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class EntityRepositoryTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('cms');
|
||||
parent::setUp();
|
||||
}
|
||||
@ -291,7 +294,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->setExpectedException('Doctrine\ORM\TransactionRequiredException');
|
||||
|
||||
$this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')
|
||||
->find(1, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ);
|
||||
->find(1, LockMode::PESSIMISTIC_READ);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -303,7 +306,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->setExpectedException('Doctrine\ORM\TransactionRequiredException');
|
||||
|
||||
$this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')
|
||||
->find(1, \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE);
|
||||
->find(1, LockMode::PESSIMISTIC_WRITE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -315,7 +318,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->setExpectedException('Doctrine\ORM\OptimisticLockException');
|
||||
|
||||
$this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser')
|
||||
->find(1, \Doctrine\DBAL\LockMode::OPTIMISTIC);
|
||||
->find(1, LockMode::OPTIMISTIC);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -336,7 +339,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId);
|
||||
|
||||
$this->setExpectedException('Doctrine\ORM\OptimisticLockException');
|
||||
$this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId, \Doctrine\DBAL\LockMode::OPTIMISTIC);
|
||||
$this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId, LockMode::OPTIMISTIC);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -671,7 +674,7 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
|
||||
$query = array_pop($this->_sqlLoggerStack->queries);
|
||||
$this->assertEquals(array(1,2,3), $query['params'][0]);
|
||||
$this->assertEquals(\Doctrine\DBAL\Connection::PARAM_INT_ARRAY, $query['types'][0]);
|
||||
$this->assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,10 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle;
|
||||
use Doctrine\Tests\Models\CMS\CmsGroup;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\DDC2504\DDC2504ChildClass;
|
||||
use Doctrine\Tests\Models\DDC2504\DDC2504OtherClass;
|
||||
use Doctrine\Tests\Models\Tweet\Tweet;
|
||||
@ -99,7 +103,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
{
|
||||
$user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId);
|
||||
|
||||
$newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$newGroup = new CmsGroup();
|
||||
$newGroup->name = "Test4";
|
||||
|
||||
$user->addGroup($newGroup);
|
||||
@ -277,7 +281,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount());
|
||||
|
||||
// Test One to Many existence with state new
|
||||
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article = new CmsArticle();
|
||||
$article->topic = "Testnew";
|
||||
$article->text = "blub";
|
||||
|
||||
@ -295,7 +299,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
// Test One to Many existence with state managed
|
||||
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article = new CmsArticle();
|
||||
$article->topic = "How to not fail anymore on tests";
|
||||
$article->text = "That is simple! Just write more tests!";
|
||||
|
||||
@ -414,7 +418,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
// Test Many to Many existence with state new
|
||||
$group = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group = new CmsGroup();
|
||||
$group->name = "A New group!";
|
||||
|
||||
$queryCount = $this->getCurrentQueryCount();
|
||||
@ -434,7 +438,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
// Test Many to Many existence with state managed
|
||||
$group = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group = new CmsGroup();
|
||||
$group->name = "My managed group";
|
||||
|
||||
$this->_em->persist($group);
|
||||
@ -461,7 +465,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed.");
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
$newUser = new \Doctrine\Tests\Models\CMS\CmsUser();
|
||||
$newUser = new CmsUser();
|
||||
$newUser->name = "A New group!";
|
||||
|
||||
$queryCount = $this->getCurrentQueryCount();
|
||||
@ -488,7 +492,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertEquals($queryCount, $this->getCurrentQueryCount());
|
||||
|
||||
// Test One to Many removal with Entity state as new
|
||||
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article = new CmsArticle();
|
||||
$article->topic = "Testnew";
|
||||
$article->text = "blub";
|
||||
|
||||
@ -510,7 +514,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
// Test One to Many removal with Entity state as managed
|
||||
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article = new CmsArticle();
|
||||
$article->topic = "How to not fail anymore on tests";
|
||||
$article->text = "That is simple! Just write more tests!";
|
||||
|
||||
@ -642,7 +646,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
// Test Many to Many removal with Entity state as new
|
||||
$group = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group = new CmsGroup();
|
||||
$group->name = "A New group!";
|
||||
|
||||
$queryCount = $this->getCurrentQueryCount();
|
||||
@ -664,7 +668,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
// Test Many to Many removal with Entity state as managed
|
||||
$group = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group = new CmsGroup();
|
||||
$group->name = "A New group!";
|
||||
|
||||
$this->_em->persist($group);
|
||||
@ -693,7 +697,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a managed entity should cause one query to be executed.");
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
|
||||
|
||||
$newUser = new \Doctrine\Tests\Models\CMS\CmsUser();
|
||||
$newUser = new CmsUser();
|
||||
$newUser->name = "A New group!";
|
||||
|
||||
$queryCount = $this->getCurrentQueryCount();
|
||||
@ -711,7 +715,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
{
|
||||
$user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId);
|
||||
|
||||
$newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$newGroup = new CmsGroup();
|
||||
$newGroup->name = "Test4";
|
||||
|
||||
$user->addGroup($newGroup);
|
||||
@ -735,7 +739,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId);
|
||||
/* @var $user CmsUser */
|
||||
|
||||
$newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$newGroup = new CmsGroup();
|
||||
$newGroup->name = "Test4";
|
||||
|
||||
$user->addGroup($newGroup);
|
||||
@ -947,22 +951,22 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
|
||||
private function loadFixture()
|
||||
{
|
||||
$user1 = new \Doctrine\Tests\Models\CMS\CmsUser();
|
||||
$user1 = new CmsUser();
|
||||
$user1->username = "beberlei";
|
||||
$user1->name = "Benjamin";
|
||||
$user1->status = "active";
|
||||
|
||||
$user2 = new \Doctrine\Tests\Models\CMS\CmsUser();
|
||||
$user2 = new CmsUser();
|
||||
$user2->username = "jwage";
|
||||
$user2->name = "Jonathan";
|
||||
$user2->status = "active";
|
||||
|
||||
$user3 = new \Doctrine\Tests\Models\CMS\CmsUser();
|
||||
$user3 = new CmsUser();
|
||||
$user3->username = "romanb";
|
||||
$user3->name = "Roman";
|
||||
$user3->status = "active";
|
||||
|
||||
$user4 = new \Doctrine\Tests\Models\CMS\CmsUser();
|
||||
$user4 = new CmsUser();
|
||||
$user4->username = "gblanco";
|
||||
$user4->name = "Guilherme";
|
||||
$user4->status = "active";
|
||||
@ -972,13 +976,13 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->_em->persist($user3);
|
||||
$this->_em->persist($user4);
|
||||
|
||||
$group1 = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group1 = new CmsGroup();
|
||||
$group1->name = "Test1";
|
||||
|
||||
$group2 = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group2 = new CmsGroup();
|
||||
$group2->name = "Test2";
|
||||
|
||||
$group3 = new \Doctrine\Tests\Models\CMS\CmsGroup();
|
||||
$group3 = new CmsGroup();
|
||||
$group3->name = "Test3";
|
||||
|
||||
$user1->addGroup($group1);
|
||||
@ -993,12 +997,12 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->_em->persist($group2);
|
||||
$this->_em->persist($group3);
|
||||
|
||||
$article1 = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article1 = new CmsArticle();
|
||||
$article1->topic = "Test1";
|
||||
$article1->text = "Test1";
|
||||
$article1->setAuthor($user1);
|
||||
|
||||
$article2 = new \Doctrine\Tests\Models\CMS\CmsArticle();
|
||||
$article2 = new CmsArticle();
|
||||
$article2->topic = "Test2";
|
||||
$article2->text = "Test2";
|
||||
$article2->setAuthor($user1);
|
||||
@ -1006,10 +1010,10 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
|
||||
$this->_em->persist($article1);
|
||||
$this->_em->persist($article2);
|
||||
|
||||
$phonenumber1 = new \Doctrine\Tests\Models\CMS\CmsPhonenumber();
|
||||
$phonenumber1 = new CmsPhonenumber();
|
||||
$phonenumber1->phonenumber = '12345';
|
||||
|
||||
$phonenumber2 = new \Doctrine\Tests\Models\CMS\CmsPhonenumber();
|
||||
$phonenumber2 = new CmsPhonenumber();
|
||||
$phonenumber2->phonenumber = '67890';
|
||||
|
||||
$this->_em->persist($phonenumber1);
|
||||
|
@ -6,15 +6,17 @@ use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\ORM\Event\OnFlushEventArgs;
|
||||
use Doctrine\ORM\Events;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* FlushEventTest
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class FlushEventTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class FlushEventTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('cms');
|
||||
parent::setUp();
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
@ -17,7 +18,7 @@ class HydrationCacheTest extends OrmFunctionalTestCase
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$user = new CmsUser;
|
||||
$user = new CmsUser();
|
||||
$user->name = "Benjamin";
|
||||
$user->username = "beberlei";
|
||||
$user->status = 'active';
|
||||
|
@ -2,10 +2,11 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\Tests\Models\CMS\CmsAddress,
|
||||
Doctrine\Tests\Models\CMS\CmsPhonenumber,
|
||||
Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* IdentityMapTest
|
||||
@ -15,9 +16,10 @@ use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class IdentityMapTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class IdentityMapTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('cms');
|
||||
parent::setUp();
|
||||
}
|
||||
|
@ -5,14 +5,15 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\StockExchange\Stock;
|
||||
use Doctrine\Tests\Models\StockExchange\Market;
|
||||
use Doctrine\Tests\Models\StockExchange\Bond;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group DDC-250
|
||||
*/
|
||||
class IndexByAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class IndexByAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* @var Doctrine\Tests\Models\StockExchange\Market
|
||||
* @var Market
|
||||
*/
|
||||
private $market;
|
||||
|
||||
|
@ -1,12 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||
use Doctrine\ORM\Event\PreFlushEventArgs;
|
||||
use Doctrine\ORM\Event\PreUpdateEventArgs;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class LifecycleCallbackTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class LifecycleCallbackTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
try {
|
||||
$this->_schemaTool->createSchema(array(
|
||||
@ -470,7 +476,7 @@ class LifecycleCallbackCascader
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->entities = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->entities = new ArrayCollection();
|
||||
}
|
||||
|
||||
/** @PostLoad */
|
||||
@ -516,7 +522,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PostPersist
|
||||
*/
|
||||
public function postPersistHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event)
|
||||
public function postPersistHandler(LifecycleEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -524,7 +530,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PrePersist
|
||||
*/
|
||||
public function prePersistHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event)
|
||||
public function prePersistHandler(LifecycleEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -532,7 +538,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PostUpdate
|
||||
*/
|
||||
public function postUpdateHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event)
|
||||
public function postUpdateHandler(LifecycleEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -540,7 +546,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PreUpdate
|
||||
*/
|
||||
public function preUpdateHandler(\Doctrine\ORM\Event\PreUpdateEventArgs $event)
|
||||
public function preUpdateHandler(PreUpdateEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -548,7 +554,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PostRemove
|
||||
*/
|
||||
public function postRemoveHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event)
|
||||
public function postRemoveHandler(LifecycleEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -556,7 +562,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PreRemove
|
||||
*/
|
||||
public function preRemoveHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event)
|
||||
public function preRemoveHandler(LifecycleEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -564,7 +570,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PreFlush
|
||||
*/
|
||||
public function preFlushHandler(\Doctrine\ORM\Event\PreFlushEventArgs $event)
|
||||
public function preFlushHandler(PreFlushEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
@ -572,7 +578,7 @@ class LifecycleCallbackEventArgEntity
|
||||
/**
|
||||
* @PostLoad
|
||||
*/
|
||||
public function postLoadHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event)
|
||||
public function postLoadHandler(LifecycleEventArgs $event)
|
||||
{
|
||||
$this->calls[__FUNCTION__] = $event;
|
||||
}
|
||||
|
@ -2,15 +2,14 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Locking;
|
||||
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle,
|
||||
Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\DBAL\LockMode,
|
||||
Doctrine\ORM\EntityManager;
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle;
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group locking_functional
|
||||
*/
|
||||
class GearmanLockTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class GearmanLockTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $gearman = null;
|
||||
private $maxRunTime = 0;
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Locking;
|
||||
|
||||
use Doctrine\Common\Cache\ArrayCache;
|
||||
use Doctrine\DBAL\Logging\EchoSQLLogger;
|
||||
use Doctrine\ORM\Configuration;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
class LockAgentWorker
|
||||
{
|
||||
private $em;
|
||||
@ -88,7 +93,7 @@ class LockAgentWorker
|
||||
|
||||
protected function createEntityManager($conn)
|
||||
{
|
||||
$config = new \Doctrine\ORM\Configuration();
|
||||
$config = new Configuration();
|
||||
$config->setProxyDir(__DIR__ . '/../../../Proxies');
|
||||
$config->setProxyNamespace('MyProject\Proxies');
|
||||
$config->setAutoGenerateProxyClasses(true);
|
||||
@ -96,12 +101,12 @@ class LockAgentWorker
|
||||
$annotDriver = $config->newDefaultAnnotationDriver(array(__DIR__ . '/../../../Models/'), true);
|
||||
$config->setMetadataDriverImpl($annotDriver);
|
||||
|
||||
$cache = new \Doctrine\Common\Cache\ArrayCache();
|
||||
$cache = new ArrayCache();
|
||||
$config->setMetadataCacheImpl($cache);
|
||||
$config->setQueryCacheImpl($cache);
|
||||
$config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
|
||||
$config->setSQLLogger(new EchoSQLLogger());
|
||||
|
||||
$em = \Doctrine\ORM\EntityManager::create($conn, $config);
|
||||
$em = EntityManager::create($conn, $config);
|
||||
|
||||
return $em;
|
||||
}
|
||||
|
@ -2,16 +2,19 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Locking;
|
||||
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle,
|
||||
Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\DBAL\LockMode,
|
||||
Doctrine\ORM\EntityManager;
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group locking
|
||||
*/
|
||||
class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase {
|
||||
protected function setUp() {
|
||||
class LockTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('cms');
|
||||
parent::setUp();
|
||||
$this->handles = array();
|
||||
@ -112,8 +115,9 @@ class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase {
|
||||
* @group DDC-178
|
||||
* @group locking
|
||||
*/
|
||||
public function testLockPessimisticWrite() {
|
||||
$writeLockSql = $this->_em->getConnection()->getDatabasePlatform()->getWriteLockSql();
|
||||
public function testLockPessimisticWrite()
|
||||
{
|
||||
$writeLockSql = $this->_em->getConnection()->getDatabasePlatform()->getWriteLockSQL();
|
||||
if (strlen($writeLockSql) == 0) {
|
||||
$this->markTestSkipped('Database Driver has no Write Lock support.');
|
||||
}
|
||||
@ -142,8 +146,9 @@ class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase {
|
||||
/**
|
||||
* @group DDC-178
|
||||
*/
|
||||
public function testLockPessimisticRead() {
|
||||
$readLockSql = $this->_em->getConnection()->getDatabasePlatform()->getReadLockSql();
|
||||
public function testLockPessimisticRead()
|
||||
{
|
||||
$readLockSql = $this->_em->getConnection()->getDatabasePlatform()->getReadLockSQL();
|
||||
if (strlen($readLockSql) == 0) {
|
||||
$this->markTestSkipped('Database Driver has no Write Lock support.');
|
||||
}
|
||||
@ -178,7 +183,7 @@ class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase {
|
||||
|
||||
$this->setExpectedException('Doctrine\ORM\OptimisticLockException', 'The optimistic lock on an entity failed.');
|
||||
$sql = $this->_em->createQuery($dql)->setHint(
|
||||
\Doctrine\ORM\Query::HINT_LOCK_MODE, \Doctrine\DBAL\LockMode::OPTIMISTIC
|
||||
Query::HINT_LOCK_MODE, LockMode::OPTIMISTIC
|
||||
)->getSQL();
|
||||
}
|
||||
}
|
||||
|
@ -2,15 +2,12 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional\Locking;
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\Common\EventManager;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataFactory;
|
||||
use Doctrine\Tests\TestUtil;
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use DateTime;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class OptimisticTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OptimisticTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -3,10 +3,12 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
use Doctrine\Tests\Models\CMS\CmsTag;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\Tests\Models\CMS\CmsGroup,
|
||||
Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Basic many-to-many association tests.
|
||||
@ -14,7 +16,7 @@ use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class ManyToManyBasicAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
@ -53,8 +55,8 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa
|
||||
$groups = $result[0]->getGroups();
|
||||
$this->assertEquals('Developers_0', $groups[0]->getName());
|
||||
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($result[0]));
|
||||
$this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($groups[0]));
|
||||
$this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($result[0]));
|
||||
$this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($groups[0]));
|
||||
|
||||
$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $groups);
|
||||
$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $groups[0]->getUsers());
|
||||
|
@ -5,13 +5,14 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsGroup;
|
||||
use Doctrine\ORM\Events;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* ManyToManyEventTest
|
||||
*
|
||||
* @author Francisco Facioni <fran6co@gmail.com>
|
||||
*/
|
||||
class ManyToManyEventTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class ManyToManyEventTest extends OrmFunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* @var PostUpdateListener
|
||||
|
@ -1,13 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\DirectoryTree\Directory;
|
||||
use Doctrine\Tests\Models\DirectoryTree\File;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* MappedSuperclassTest
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class MappedSuperclassTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class MappedSuperclassTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
$this->useModelSet('directorytree');
|
||||
@ -16,15 +19,15 @@ class MappedSuperclassTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
|
||||
public function testCRUD()
|
||||
{
|
||||
$root = new \Doctrine\Tests\Models\DirectoryTree\Directory();
|
||||
$root = new Directory();
|
||||
$root->setName('Root');
|
||||
$root->setPath('/root');
|
||||
|
||||
$directory = new \Doctrine\Tests\Models\DirectoryTree\Directory($root);
|
||||
$directory = new Directory($root);
|
||||
$directory->setName('TestA');
|
||||
$directory->setPath('/root/dir');
|
||||
|
||||
$file = new \Doctrine\Tests\Models\DirectoryTree\File($directory);
|
||||
$file = new File($directory);
|
||||
$file->setName('test-b.html');
|
||||
|
||||
$this->_em->persist($root);
|
||||
|
@ -4,8 +4,9 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\MixedToOneIdentity\CompositeToOneKeyState;
|
||||
use Doctrine\Tests\Models\MixedToOneIdentity\Country;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class MergeCompositeToOneKeyTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class MergeCompositeToOneKeyTest extends OrmFunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
@ -2,15 +2,14 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\OptimisticLockException;
|
||||
use Doctrine\ORM\ORMException;
|
||||
use Doctrine\Tests\Models\VersionedManyToOne\Article;
|
||||
use Doctrine\Tests\Models\VersionedManyToOne\Category;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group MergeVersionedOneToMany
|
||||
*/
|
||||
class MergeVersionedManyToOneTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class MergeVersionedManyToOneTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -13,17 +13,19 @@ use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsEmail;
|
||||
use Doctrine\Tests\Models\Company\CompanyEmployee;
|
||||
use Doctrine\Tests\Models\Company\CompanyPerson;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* NativeQueryTest
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class NativeQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class NativeQueryTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $platform = null;
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
$this->useModelSet('cms');
|
||||
$this->useModelSet('company');
|
||||
parent::setUp();
|
||||
@ -197,7 +199,7 @@ class NativeQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$rsm = new ResultSetMapping;
|
||||
|
||||
$q = $this->_em->createNativeQuery('SELECT id, name, status, phonenumber FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username = ?', $rsm);
|
||||
$q2 = $q->setSql('foo', $rsm)
|
||||
$q2 = $q->setSQL('foo')
|
||||
->setResultSetMapping($rsm)
|
||||
->expireResultCache(true)
|
||||
->setHint('foo', 'bar')
|
||||
|
@ -7,11 +7,12 @@ use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsEmail;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group DDC-1574
|
||||
*/
|
||||
class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class NewOperatorTest extends OrmFunctionalTestCase
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
|
@ -1,18 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection,
|
||||
Doctrine\Common\NotifyPropertyChanged,
|
||||
Doctrine\Common\PropertyChangedListener;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\NotifyPropertyChanged;
|
||||
use Doctrine\Common\PropertyChangedListener;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* NativeQueryTest
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class NotifyPolicyTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class NotifyPolicyTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
try {
|
||||
$this->_schemaTool->createSchema(array(
|
||||
|
@ -5,11 +5,12 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceProduct;
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceFeature;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a bidirectional one-to-one association mapping (without inheritance).
|
||||
*/
|
||||
class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToManyBidirectionalAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $product;
|
||||
private $firstFeature;
|
||||
|
@ -3,13 +3,13 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\Tests\Models\CMS\CmsAddress,
|
||||
Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a bidirectional one-to-many association mapping with orphan removal.
|
||||
*/
|
||||
class OneToManyOrphanRemovalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToManyOrphanRemovalTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected $userId;
|
||||
|
||||
|
@ -5,11 +5,12 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceCategory;
|
||||
use Doctrine\ORM\Mapping\AssociationMapping;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a bidirectional one-to-one association mapping (without inheritance).
|
||||
*/
|
||||
class OneToManySelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToManySelfReferentialAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $parent;
|
||||
private $firstChild;
|
||||
|
@ -5,11 +5,12 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\Routing\RoutingRoute;
|
||||
use Doctrine\Tests\Models\Routing\RoutingLocation;
|
||||
use Doctrine\Tests\Models\Routing\RoutingLeg;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a bidirectional one-to-one association mapping (without inheritance).
|
||||
*/
|
||||
class OneToManyUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToManyUnidirectionalAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected $locations = array();
|
||||
|
||||
|
@ -6,11 +6,12 @@ use Doctrine\Tests\Models\ECommerce\ECommerceCart;
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceCustomer;
|
||||
use Doctrine\ORM\Mapping\AssociationMapping;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a bidirectional one-to-one association mapping (without inheritance).
|
||||
*/
|
||||
class OneToOneBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToOneBidirectionalAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $customer;
|
||||
private $cart;
|
||||
@ -88,7 +89,7 @@ class OneToOneBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctional
|
||||
$customer = $result[0];
|
||||
|
||||
$this->assertNull($customer->getMentor());
|
||||
$this->assertInstanceOF('Doctrine\Tests\Models\ECommerce\ECommerceCart', $customer->getCart());
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCart', $customer->getCart());
|
||||
$this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $customer->getCart());
|
||||
$this->assertEquals('paypal', $customer->getCart()->getPayment());
|
||||
}
|
||||
|
@ -1,16 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Tools\SchemaTool;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @group DDC-952
|
||||
*/
|
||||
class OneToOneEagerLoadingTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToOneEagerLoadingTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$schemaTool = new \Doctrine\ORM\Tools\SchemaTool($this->_em);
|
||||
$schemaTool = new SchemaTool($this->_em);
|
||||
try {
|
||||
$schemaTool->createSchema(array(
|
||||
$this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Train'),
|
||||
@ -248,7 +251,7 @@ class Train
|
||||
|
||||
public function __construct(TrainOwner $owner)
|
||||
{
|
||||
$this->waggons = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->waggons = new ArrayCollection();
|
||||
$this->setOwner($owner);
|
||||
}
|
||||
|
||||
|
@ -4,13 +4,13 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\Tests\Models\CMS\CmsEmail,
|
||||
Doctrine\Tests\Models\CMS\CmsAddress,
|
||||
Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a bidirectional one-to-one association mapping with orphan removal.
|
||||
*/
|
||||
class OneToOneOrphanRemovalTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToOneOrphanRemovalTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceCustomer;
|
||||
use Doctrine\ORM\Mapping\AssociationMapping;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a self referential one-to-one association mapping (without inheritance).
|
||||
@ -13,7 +14,7 @@ use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
* for receiving support.
|
||||
* Inverse side is not present.
|
||||
*/
|
||||
class OneToOneSelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToOneSelfReferentialAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $customer;
|
||||
private $mentor;
|
||||
|
@ -2,10 +2,6 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceProduct;
|
||||
use Doctrine\Tests\Models\ECommerce\ECommerceShipping;
|
||||
use Doctrine\ORM\Mapping\AssociationMapping;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\Models\OneToOneSingleTableInheritance\Cat;
|
||||
use Doctrine\Tests\Models\OneToOneSingleTableInheritance\LitterBox;
|
||||
|
@ -7,12 +7,13 @@ use Doctrine\Tests\Models\ECommerce\ECommerceShipping;
|
||||
use Doctrine\ORM\Mapping\AssociationMapping;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Tests a unidirectional one-to-one association mapping (without inheritance).
|
||||
* Inverse side is not present.
|
||||
*/
|
||||
class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OneToOneUnidirectionalAssociationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
private $product;
|
||||
private $shipping;
|
||||
|
@ -6,8 +6,9 @@ use Doctrine\Tests\Models\Routing\RoutingRoute;
|
||||
use Doctrine\Tests\Models\Routing\RoutingLocation;
|
||||
use Doctrine\Tests\Models\Routing\RoutingLeg;
|
||||
use Doctrine\Tests\Models\Routing\RoutingRouteBooking;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class OrderedCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OrderedCollectionTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected $locations = array();
|
||||
|
||||
|
@ -3,15 +3,17 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Functional tests for the Single Table Inheritance mapping strategy.
|
||||
*
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
*/
|
||||
class OrderedJoinedTableInheritanceCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class OrderedJoinedTableInheritanceCollectionTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp() {
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
try {
|
||||
$this->_schemaTool->createSchema(array(
|
||||
|
@ -13,12 +13,13 @@ use Doctrine\Tests\Models\Pagination\Company;
|
||||
use Doctrine\Tests\Models\Pagination\Department;
|
||||
use Doctrine\Tests\Models\Pagination\Logo;
|
||||
use Doctrine\Tests\Models\Pagination\User1;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
use ReflectionMethod;
|
||||
|
||||
/**
|
||||
* @group DDC-1613
|
||||
*/
|
||||
class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class PaginationTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -23,11 +23,12 @@ use Doctrine\Tests\Models\Quote\Group;
|
||||
use Doctrine\Tests\Models\Quote\User as QuoteUser;
|
||||
use Doctrine\Tests\Models\Tweet\Tweet;
|
||||
use Doctrine\Tests\Models\Tweet\User as TweetUser;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Michaël Gallego <mic.gallego@gmail.com>
|
||||
*/
|
||||
class PersistentCollectionCriteriaTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class PersistentCollectionCriteriaTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
@ -2,12 +2,14 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Common\Persistence\PersistentObject;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
*/
|
||||
class PersistentCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class PersistentCollectionTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
@ -114,7 +116,7 @@ class PersistentCollectionHolder extends PersistentObject
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->collection = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->collection = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Persistence\PersistentObject;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* Test that Doctrine ORM correctly works with the ObjectManagerAware and PersistentObject
|
||||
@ -10,7 +11,7 @@ use Doctrine\Common\Persistence\PersistentObject;
|
||||
*
|
||||
* @group DDC-1448
|
||||
*/
|
||||
class PersistentObjectTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
class PersistentObjectTest extends OrmFunctionalTestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user