Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
68147808
Commit
68147808
authored
Feb 18, 2009
by
jwage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Cleaning up tests and removing some unused files to remove any confusion
parent
b8b8f85d
Changes
53
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
234 additions
and
780 deletions
+234
-780
AllTests.php
tests/Doctrine/Tests/AllTests.php
+0
-5
ClassA.class.php
tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php
+1
-0
ClassB.class.php
tests/Doctrine/Tests/Common/ClassLoaderTest/ClassB.class.php
+1
-0
AllTests.php
tests/Doctrine/Tests/Common/Collections/AllTests.php
+0
-3
CollectionTest.php
tests/Doctrine/Tests/Common/Collections/CollectionTest.php
+0
-6
EventManagerTest.php
tests/Doctrine/Tests/Common/EventManagerTest.php
+3
-13
AllTests.php
tests/Doctrine/Tests/DBAL/AllTests.php
+0
-6
AllTests.php
tests/Doctrine/Tests/DBAL/Ticket/AllTests.php
+0
-33
Test1.php
tests/Doctrine/Tests/DBAL/Ticket/Test1.php
+0
-13
ClassMetadataMock.php
tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
+3
-3
ConnectionMock.php
tests/Doctrine/Tests/Mocks/ConnectionMock.php
+3
-3
DatabasePlatformMock.php
tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
+3
-4
DriverConnectionMock.php
tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
+1
-2
DriverMock.php
tests/Doctrine/Tests/Mocks/DriverMock.php
+1
-2
EntityManagerMock.php
tests/Doctrine/Tests/Mocks/EntityManagerMock.php
+1
-2
EntityPersisterMock.php
tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
+3
-3
IdentityIdGeneratorMock.php
tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
+1
-7
MetadataDriverMock.php
tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
+6
-13
SchemaManagerMock.php
tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
+3
-12
UnitOfWorkMock.php
tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
+7
-10
CmsAddress.php
tests/Doctrine/Tests/Models/CMS/CmsAddress.php
+7
-8
CompanyEmployee.php
tests/Doctrine/Tests/Models/Company/CompanyEmployee.php
+28
-36
CompanyManager.php
tests/Doctrine/Tests/Models/Company/CompanyManager.php
+10
-10
AllTests.php
tests/Doctrine/Tests/ORM/AllTests.php
+1
-1
AllTests.php
tests/Doctrine/Tests/ORM/Associations/AllTests.php
+1
-1
CascadeTest.php
tests/Doctrine/Tests/ORM/Associations/CascadeTest.php
+0
-74
OneToOneMappingTest.php
...s/Doctrine/Tests/ORM/Associations/OneToOneMappingTest.php
+3
-6
CommitOrderCalculatorTest.php
tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php
+1
-2
AccessorTest.php
tests/Doctrine/Tests/ORM/Entity/AccessorTest.php
+0
-87
AllTests.php
tests/Doctrine/Tests/ORM/Entity/AllTests.php
+0
-1
EntityManagerTest.php
tests/Doctrine/Tests/ORM/EntityManagerTest.php
+2
-4
EntityPersisterTest.php
tests/Doctrine/Tests/ORM/EntityPersisterTest.php
+4
-7
AllTests.php
tests/Doctrine/Tests/ORM/Export/AllTests.php
+1
-9
ClassExporterTest.php
tests/Doctrine/Tests/ORM/Export/ClassExporterTest.php
+4
-36
AllTests.php
tests/Doctrine/Tests/ORM/Functional/AllTests.php
+0
-2
BasicCRUDTest.php
tests/Doctrine/Tests/ORM/Functional/BasicCRUDTest.php
+7
-11
1Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/1Test.php
+0
-10
AllTests.php
tests/Doctrine/Tests/ORM/Functional/Ticket/AllTests.php
+0
-30
AllTests.php
tests/Doctrine/Tests/ORM/Hydration/AllTests.php
+1
-1
ArrayHydratorTest.php
tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php
+3
-8
HydrationTest.php
tests/Doctrine/Tests/ORM/Hydration/HydrationTest.php
+1
-7
ObjectHydratorTest.php
tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php
+18
-23
ScalarHydratorTest.php
tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php
+1
-7
SingleScalarHydratorTest.php
...Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php
+1
-8
AllTests.php
tests/Doctrine/Tests/ORM/Mapping/AllTests.php
+1
-1
ClassMetadataFactoryTest.php
...s/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php
+23
-19
ClassMetadataTest.php
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
+2
-1
AllTests.php
tests/Doctrine/Tests/ORM/Performance/AllTests.php
+0
-30
AllTests.php
tests/Doctrine/Tests/ORM/Query/AllTests.php
+3
-12
LanguageRecognitionTest.php
tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php
+72
-112
SelectSqlGenerationTest.php
tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php
+2
-36
1Test.php
tests/Doctrine/Tests/ORM/Ticket/1Test.php
+0
-10
AllTests.php
tests/Doctrine/Tests/ORM/Ticket/AllTests.php
+0
-30
No files found.
tests/Doctrine/Tests/AllTests.php
View file @
68147808
...
...
@@ -12,11 +12,6 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
require_once
__DIR__
.
'/TestInit.php'
;
// Suites
#require_once 'Common/AllTests.php';
#require_once 'Dbal/AllTests.php';
#require_once 'Orm/AllTests.php';
class
AllTests
{
public
static
function
main
()
...
...
tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php
View file @
68147808
<?php
class
ClassLoaderTest_ClassA
{
...
...
tests/Doctrine/Tests/Common/ClassLoaderTest/ClassB.class.php
View file @
68147808
<?php
class
ClassLoaderTest_ClassB
{
...
...
tests/Doctrine/Tests/Common/Collections/AllTests.php
View file @
68147808
...
...
@@ -8,9 +8,6 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
require_once
__DIR__
.
'/../../TestInit.php'
;
// Tests
#require_once 'Common/Collections/CollectionTest.php';
class
AllTests
{
public
static
function
main
()
...
...
tests/Doctrine/Tests/Common/Collections/CollectionTest.php
View file @
68147808
...
...
@@ -6,12 +6,6 @@ use Doctrine\Tests;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Collection tests.
*
* @author robo
* @since 2.0
*/
class
CollectionTest
extends
\Doctrine\Tests\DoctrineTestCase
{
private
$_coll
;
...
...
tests/Doctrine/Tests/Common/EventManagerTest.php
View file @
68147808
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
namespace
Doctrine\Tests\Common
;
use
Doctrine\Common\EventManager
;
use
Doctrine\Common\EventArgs
;
/**
* Description of EventManagerTest
*
* @author robo
*/
class
EventManagerTest
extends
\Doctrine\Tests\DoctrineTestCase
{
/* Some pseudo events */
...
...
@@ -25,7 +16,8 @@ class EventManagerTest extends \Doctrine\Tests\DoctrineTestCase
private
$_eventManager
;
protected
function
setUp
()
{
protected
function
setUp
()
{
$this
->
_eventManager
=
new
EventManager
;
$this
->
_preFooInvoked
=
false
;
$this
->
_postFooInvoked
=
false
;
...
...
@@ -56,7 +48,6 @@ class EventManagerTest extends \Doctrine\Tests\DoctrineTestCase
$this
->
assertFalse
(
$this
->
_postFooInvoked
);
}
/* Listener methods */
public
function
preFoo
(
EventArgs
$e
)
...
...
@@ -69,4 +60,3 @@ class EventManagerTest extends \Doctrine\Tests\DoctrineTestCase
$this
->
_postFooInvoked
=
true
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/AllTests.php
View file @
68147808
...
...
@@ -11,10 +11,6 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
require_once
__DIR__
.
'/../TestInit.php'
;
// Suites
#require_once 'Dbal/Component/AllTests.php';
#require_once 'Dbal/Ticket/AllTests.php';
class
AllTests
{
public
static
function
main
()
...
...
@@ -28,8 +24,6 @@ class AllTests
$suite
->
addTestSuite
(
'Doctrine\Tests\DBAL\Platforms\AbstractPlatformTest'
);
$suite
->
addTest
(
Ticket\AllTests
::
suite
());
return
$suite
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Ticket/AllTests.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
namespace
Doctrine\Tests\DBAL\Ticket
;
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
define
(
'PHPUnit_MAIN_METHOD'
,
'Ticket_AllTests::main'
);
}
require_once
__DIR__
.
'/../../TestInit.php'
;
// Tests
#require_once 'Dbal/Ticket/1Test.php';
class
AllTests
{
public
static
function
main
()
{
\PHPUnit_TextUI_TestRunner
::
run
(
self
::
suite
());
}
public
static
function
suite
()
{
$suite
=
new
\Doctrine\Tests\DoctrineTestSuite
(
'Doctrine Orm'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\DBAL\Ticket\Test1'
);
return
$suite
;
}
}
if
(
PHPUnit_MAIN_METHOD
==
'Ticket_AllTests::main'
)
{
AllTests
::
main
();
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Ticket/Test1.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
namespace
Doctrine\Tests\DBAL\Ticket
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
Test1
extends
\Doctrine\Tests\DbalTestCase
{
public
function
testTest
()
{
$this
->
assertEquals
(
0
,
0
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
View file @
68147808
...
...
@@ -6,9 +6,9 @@ class ClassMetadataMock extends \Doctrine\ORM\Mapping\ClassMetadata
{
/* Mock API */
public
function
setIdGeneratorType
(
$type
)
{
public
function
setIdGeneratorType
(
$type
)
{
$this
->
_generatorType
=
$type
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/ConnectionMock.php
View file @
68147808
...
...
@@ -8,7 +8,8 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
private
$_lastInsertId
=
0
;
private
$_inserts
=
array
();
public
function
__construct
(
array
$params
,
$driver
,
$config
=
null
,
$eventManager
=
null
)
{
public
function
__construct
(
array
$params
,
$driver
,
$config
=
null
,
$eventManager
=
null
)
{
parent
::
__construct
(
$params
,
$driver
,
$config
,
$eventManager
);
$this
->
_platformMock
=
new
DatabasePlatformMock
();
$this
->
_platform
=
$this
->
_platformMock
;
...
...
@@ -72,4 +73,3 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
$this
->
_lastInsertId
=
0
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
View file @
68147808
...
...
@@ -19,7 +19,8 @@ class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
/**
* @override
*/
public
function
prefersIdentityColumns
()
{
public
function
prefersIdentityColumns
()
{
return
$this
->
_prefersIdentityColumns
;
}
...
...
@@ -50,6 +51,4 @@ class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
{
$this
->
_prefersIdentityColumns
=
(
bool
)
$bool
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
View file @
68147808
...
...
@@ -15,4 +15,3 @@ class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection
public
function
errorCode
()
{}
public
function
errorInfo
()
{}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/DriverMock.php
View file @
68147808
...
...
@@ -49,4 +49,3 @@ class DriverMock implements \Doctrine\DBAL\Driver
$this
->
_platformMock
=
$platform
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/EntityManagerMock.php
View file @
68147808
...
...
@@ -87,4 +87,3 @@ class EntityManagerMock extends \Doctrine\ORM\EntityManager
return
parent
::
getIdGenerator
(
$className
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
View file @
68147808
...
...
@@ -28,7 +28,8 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\StandardEntityPersist
return
null
;
}
public
function
setMockIdGeneratorType
(
$genType
)
{
public
function
setMockIdGeneratorType
(
$genType
)
{
$this
->
_mockIdGeneratorType
=
$genType
;
}
...
...
@@ -65,4 +66,3 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\StandardEntityPersist
$this
->
_deletes
=
array
();
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
View file @
68147808
...
...
@@ -2,11 +2,6 @@
namespace
Doctrine\Tests\Mocks
;
/**
* Description of Doctrine_IdentityIdGeneratorMock
*
* @author robo
*/
class
IdentityIdGeneratorMock
extends
\Doctrine\ORM\Id\IdentityGenerator
{
private
$_mockPostInsertId
;
...
...
@@ -15,4 +10,3 @@ class IdentityIdGeneratorMock extends \Doctrine\ORM\Id\IdentityGenerator
$this
->
_mockPostInsertId
=
$id
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
View file @
68147808
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
namespace
Doctrine\Tests\Mocks
;
/**
* Description of Doctrine_MetadataDriverMock
*
* @author robo
*/
class
MetadataDriverMock
{
public
function
loadMetadataForClass
(
$className
,
\Doctrine\ORM\Mapping\ClassMetadata
$metadata
)
{
public
function
loadMetadataForClass
(
$className
,
\Doctrine\ORM\Mapping\ClassMetadata
$metadata
)
{
return
;
}
public
function
isTransient
(
$className
)
{
public
function
isTransient
(
$className
)
{
return
false
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
View file @
68147808
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
namespace
Doctrine\Tests\Mocks
;
/**
* Description of SchemaManagerMock
*
* @author robo
*/
class
SchemaManagerMock
extends
\Doctrine\DBAL\Schema\AbstractSchemaManager
{
public
function
__construct
(
\Doctrine\DBAL\Connection
$conn
)
{
public
function
__construct
(
\Doctrine\DBAL\Connection
$conn
)
{
parent
::
__construct
(
$conn
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
View file @
68147808
...
...
@@ -2,12 +2,8 @@
namespace
Doctrine\Tests\Mocks
;
/**
* Description of Doctrine_UnitOfWorkMock
*
* @author robo
*/
class
UnitOfWorkMock
extends
\Doctrine\ORM\UnitOfWork
{
class
UnitOfWorkMock
extends
\Doctrine\ORM\UnitOfWork
{
private
$_mockDataChangeSets
=
array
();
private
$_persisterMock
;
...
...
@@ -24,7 +20,8 @@ class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork {
* @param <type> $entity
* @override
*/
public
function
getEntityChangeSet
(
$entity
)
{
public
function
getEntityChangeSet
(
$entity
)
{
$oid
=
spl_object_hash
(
$entity
);
return
isset
(
$this
->
_mockDataChangeSets
[
$oid
])
?
$this
->
_mockDataChangeSets
[
$oid
]
:
parent
::
getEntityChangeSet
(
$entity
);
...
...
@@ -44,7 +41,8 @@ class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork {
$this
->
_persisterMock
[
$entityName
]
=
$persister
;
}
public
function
setDataChangeSet
(
$entity
,
array
$mockChangeSet
)
{
public
function
setDataChangeSet
(
$entity
,
array
$mockChangeSet
)
{
$this
->
_mockDataChangeSets
[
spl_object_hash
(
$entity
)]
=
$mockChangeSet
;
}
...
...
@@ -58,4 +56,3 @@ class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork {
$this
->
_originalEntityData
[
spl_object_hash
(
$entity
)]
=
$originalData
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/Models/CMS/CmsAddress.php
View file @
68147808
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
namespace
Doctrine\Tests\Models\CMS
;
/**
*
Description of
CmsAddress
* CmsAddress
*
* @author
robo
* @author
Roman S. Borschel
* @DoctrineEntity
* @DoctrineTable(name="cms_addresses")
*/
...
...
@@ -21,22 +17,25 @@ class CmsAddress
* @DoctrineIdGenerator("auto")
*/
public
$id
;
/**
* @DoctrineColumn(type="varchar", length=50)
*/
public
$country
;
/**
* @DoctrineColumn(type="varchar", length=50)
*/
public
$zip
;
/**
* @DoctrineColumn(type="varchar", length=50)
*/
public
$city
;
/**
* @DoctrineOneToOne(targetEntity="CmsUser")
* @DoctrineJoinColumn(name="user_id", referencedColumnName="id")
*/
public
$user
;
}
\ No newline at end of file
tests/Doctrine/Tests/Models/Company/CompanyEmployee.php
View file @
68147808
<?php
namespace
Doctrine\Tests\Models\Company
;
/**
* @DoctrineEntity
* @DoctrineTable(name="company_employee")
* @DoctrineInheritanceType("joined")
* @DoctrineDiscriminatorColumn(name="dtype", type="varchar", length=20)
* @DoctrineDiscriminatorMap({
"emp" = "Doctrine\Tests\Models\Company\CompanyEmployee",
"man" = "Doctrine\Tests\Models\Company\CompanyManager"})
* @DoctrineSubclasses({"Doctrine\Tests\Models\Company\CompanyManager"})
*/
class
CompanyEmployee
{
#protected $id;
#protected $salary;
#protected $department;
public
static
function
initMetadata
(
$mapping
)
{
// inheritance mapping
$mapping
->
setInheritanceType
(
'joined'
,
array
(
'discriminatorColumn'
=>
'dtype'
,
'discriminatorMap'
=>
array
(
'emp'
=>
'CompanyEmployee'
,
'man'
=>
'CompanyManager'
)
));
// register subclasses
$mapping
->
setSubclasses
(
array
(
'CompanyManager'
));
/**
* @DoctrineId
* @DoctrineColumn(type="integer")
* @DoctrineIdGenerator("auto")
*/
public
$id
;
$mapping
->
mapField
(
array
(
'fieldName'
=>
'id'
,
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
,
'idGenerator'
=>
'auto'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'salary'
,
'type'
=>
'double'
));
//TODO: make department an entity
$mapping
->
mapField
(
array
(
'fieldName'
=>
'department'
,
'type'
=>
'string'
));
}
/**
* @DoctrineColumn(type="double")
*/
public
$salary
;
/**
* @DoctrineColumn(type="varchar", length=255)
*/
public
$department
;
}
\ No newline at end of file
?>
\ No newline at end of file
tests/Doctrine/Tests/Models/Company/CompanyManager.php
View file @
68147808
<?php
namespace
Doctrine\Tests\Models\Company
;
/**
* @DoctrineEntity
*/
class
CompanyManager
extends
CompanyEmployee
{
public
static
function
initMetadata
(
$mapping
)
{
$mapping
->
mapColumn
(
array
(
'fieldName'
=>
'title'
,
'type'
=>
'string'
));
}
/*
* @DoctrineColumn(type="varchar", length="255")
*/
public
$title
;
}
\ No newline at end of file
?>
\ No newline at end of file
tests/Doctrine/Tests/ORM/AllTests.php
View file @
68147808
tests/Doctrine/Tests/ORM/Associations/AllTests.php
View file @
68147808
tests/Doctrine/Tests/ORM/Associations/CascadeTest.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
require_once
'lib/DoctrineTestInit.php'
;
class
Orm_Associations_CascadeTest
extends
Doctrine_OrmTestCase
{
protected
function
setUp
()
{
;
}
protected
function
tearDown
()
{
;
}
public
function
testDeleteCascade
()
{
$container
=
array
();
$cascade
=
new
DeleteCascade
();
$cascade
->
cascade
(
$entity
,
$container
);
}
}
abstract
class
Cascade
{
public
function
cascade
(
Doctrine_Entity
$record
,
array
&
$container
)
{
if
(
$this
->
shouldCascadeTo
(
$record
))
{
$container
[
$record
->
getOid
()]
=
$record
;
}
foreach
(
$record
->
getTable
()
->
getRelations
()
as
$relation
)
{
if
(
$this
->
doCascade
(
$relation
))
{
$this
->
prepareCascade
(
$record
,
$relation
);
$relatedObjects
=
$record
->
get
(
$relation
->
getAlias
());
if
(
$relatedObjects
instanceof
Doctrine_Record
&&
$this
->
shouldCascadeTo
(
$relatedObjects
)
&&
!
isset
(
$container
[
$relatedObjects
->
getOid
()]))
{
$this
->
cascade
(
$relatedObjects
,
$container
);
}
else
if
(
$relatedObjects
instanceof
Doctrine_Collection
&&
count
(
$relatedObjects
)
>
0
)
{
foreach
(
$relatedObjects
as
$object
)
{
if
(
!
isset
(
$container
[
$object
->
getOid
()]))
{
$this
->
cascade
(
$object
,
$container
);
}
}
}
}
}
}
}
class
DeleteCascade
extends
Cascade
{
public
function
doCascade
(
$relation
)
{
return
$relation
->
isCascadeDelete
();
}
public
function
prepareCascade
(
$record
,
$relation
)
{
$fieldName
=
$relation
->
getAlias
();
// if it's a xToOne relation and the related object is already loaded
// we don't need to refresh, else we need to.
if
(
!
(
$relation
->
getType
()
==
Doctrine_Relation
::
ONE
&&
isset
(
$record
->
$fieldName
)))
{
$record
->
refreshRelated
(
$relation
->
getAlias
());
}
}
public
function
shouldCascadeTo
(
Doctrine_Entity
$entity
)
{
//TODO: also ignore removed Entities. incorporate that in exists() with a new
// state? (DELETED?)
return
!
$entity
->
exists
();
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Associations/OneToOneMappingTest.php
View file @
68147808
...
...
@@ -24,7 +24,6 @@ class OneToOneMappingTest extends \Doctrine\Tests\OrmTestCase
$this
->
assertEquals
(
'address'
,
$oneToOneMapping
->
getSourceFieldName
());
$this
->
assertTrue
(
$oneToOneMapping
->
isOwningSide
());
$inverseSideMapping
=
array
(
'fieldName'
=>
'person'
,
'sourceEntity'
=>
'Address'
,
...
...
@@ -37,7 +36,5 @@ class OneToOneMappingTest extends \Doctrine\Tests\OrmTestCase
$this
->
assertEquals
(
'Address'
,
$oneToOneMapping
->
getSourceEntityName
());
$this
->
assertEquals
(
'Person'
,
$oneToOneMapping
->
getTargetEntityName
());
$this
->
assertTrue
(
$oneToOneMapping
->
isInverseSide
());
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php
View file @
68147808
...
...
@@ -48,6 +48,5 @@ class CommitOrderCalculatorTest extends \Doctrine\Tests\OrmTestCase
// There is only 1 valid ordering for this constellation
$correctOrder
=
array
(
"node5"
,
"node1"
,
"node2"
,
"node3"
,
"node4"
);
$this
->
assertSame
(
$correctOrder
,
$sorted
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Entity/AccessorTest.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
/* CURRENTLY NOT USED */
require_once
'lib/DoctrineTestInit.php'
;
class
Orm_Entity_AccessorTest
extends
Doctrine_OrmTestCase
{
public
function
testGetterSetterOverride
()
{
$entity1
=
new
CustomAccessorMutatorTestEntity
();
$entity1
->
username
=
'romanb'
;
$this
->
assertEquals
(
'romanb?!'
,
$entity1
->
username
);
$entity2
=
new
MagicAccessorMutatorTestEntity
();
$entity2
->
username
=
'romanb'
;
$this
->
assertEquals
(
'romanb?!'
,
$entity1
->
username
);
}
}
/* Local test classes */
class
CustomAccessorMutatorTestEntity
extends
Doctrine_Common_VirtualPropertyObject
{
static
function
construct
()
{
Doctrine_Common_VirtualPropertySystem
::
register
(
__CLASS__
,
'id'
,
'int'
);
Doctrine_Common_VirtualPropertySystem
::
register
(
__CLASS__
,
'username'
,
'string'
,
'getUsernameCustom'
,
'setUsernameCustom'
);
}
public
static
function
initMetadata
(
$mapping
)
{
$mapping
->
mapField
(
array
(
'fieldName'
=>
'id'
,
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'username'
,
'type'
=>
'string'
,
'length'
=>
50
));
}
public
function
getUsernameCustom
()
{
return
$this
->
_get
(
'username'
)
.
"!"
;
}
public
function
setUsernameCustom
(
$username
)
{
$this
->
_set
(
'username'
,
$username
.
"?"
);
}
}
class
MagicAccessorMutatorTestEntity
extends
Doctrine_Common_VirtualPropertyObject
{
static
function
construct
()
{
Doctrine_Common_VirtualPropertySystem
::
register
(
__CLASS__
,
'id'
,
'int'
);
Doctrine_Common_VirtualPropertySystem
::
register
(
__CLASS__
,
'username'
,
'string'
);
}
public
static
function
initMetadata
(
$mapping
)
{
$mapping
->
mapField
(
array
(
'fieldName'
=>
'id'
,
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'username'
,
'type'
=>
'string'
,
'length'
=>
50
));
}
public
function
getUsername
()
{
return
$this
->
_get
(
'username'
)
.
"!"
;
}
public
function
setUsername
(
$username
)
{
$this
->
_set
(
'username'
,
$username
.
"?"
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Entity/AllTests.php
View file @
68147808
...
...
@@ -20,7 +20,6 @@ class AllTests
{
$suite
=
new
\Doctrine\Tests\DoctrineTestSuite
(
'Doctrine Orm Entity Tests'
);
//$suite->addTestSuite('Orm_Entity_AccessorTest');
$suite
->
addTestSuite
(
'Doctrine\Tests\ORM\Entity\ConstructorTest'
);
return
$suite
;
...
...
tests/Doctrine/Tests/ORM/EntityManagerTest.php
View file @
68147808
...
...
@@ -4,14 +4,12 @@ namespace Doctrine\Tests\ORM;
require_once
__DIR__
.
'/../TestInit.php'
;
/**
* EntityManager tests.
*/
class
EntityManagerTest
extends
\Doctrine\Tests\OrmTestCase
{
private
$_em
;
function
setUp
()
{
function
setUp
()
{
parent
::
setUp
();
$this
->
_em
=
$this
->
_getTestEntityManager
();
}
...
...
tests/Doctrine/Tests/ORM/EntityPersisterTest.php
View file @
68147808
...
...
@@ -12,9 +12,6 @@ use Doctrine\Tests\Models\Forum\ForumAvatar;
require_once
__DIR__
.
'/../TestInit.php'
;
/**
* EntityPersister tests.
*/
class
EntityPersisterTest
extends
\Doctrine\Tests\OrmTestCase
{
private
$_connMock
;
...
...
@@ -22,7 +19,8 @@ class EntityPersisterTest extends \Doctrine\Tests\OrmTestCase
private
$_idGenMock
;
private
$_uowMock
;
protected
function
setUp
()
{
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
_connMock
=
new
ConnectionMock
(
array
(),
new
\Doctrine\Tests\Mocks\DriverMock
());
$this
->
_emMock
=
EntityManagerMock
::
create
(
$this
->
_connMock
);
...
...
@@ -32,7 +30,8 @@ class EntityPersisterTest extends \Doctrine\Tests\OrmTestCase
$this
->
_emMock
->
setIdGenerator
(
'Doctrine\Tests\Models\Forum\ForumUser'
,
$this
->
_idGenMock
);
}
public
function
testSimpleInsert
()
{
public
function
testSimpleInsert
()
{
$userPersister
=
new
\Doctrine\ORM\Persisters\StandardEntityPersister
(
$this
->
_emMock
,
$this
->
_emMock
->
getClassMetadata
(
"Doctrine\Tests\Models\Forum\ForumUser"
));
$avatarPersister
=
new
\Doctrine\ORM\Persisters\StandardEntityPersister
(
...
...
@@ -46,7 +45,6 @@ class EntityPersisterTest extends \Doctrine\Tests\OrmTestCase
'username'
=>
array
(
''
,
'romanb'
),
'avatar'
=>
array
(
''
,
$user
->
avatar
)));
//insert
$avatarPersister
->
insert
(
$user
->
avatar
);
$inserts
=
$this
->
_connMock
->
getInserts
();
...
...
@@ -76,5 +74,4 @@ class EntityPersisterTest extends \Doctrine\Tests\OrmTestCase
$this
->
assertTrue
(
isset
(
$inserts
[
'forum_users'
][
0
][
'dtype'
]));
$this
->
assertEquals
(
'user'
,
$inserts
[
'forum_users'
][
0
][
'dtype'
]);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Export/AllTests.php
View file @
68147808
...
...
@@ -10,14 +10,6 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
require_once
__DIR__
.
'/../../TestInit.php'
;
#require_once 'IdentifierRecognitionTest.php';
/*require_once 'ScannerTest.php';
require_once 'DqlGenerationTest.php';
require_once 'DeleteSqlGenerationTest.php';
require_once 'UpdateSqlGenerationTest.php';
require_once 'SelectSqlGenerationTest.php';
require_once 'LanguageRecognitionTest.php';*/
class
AllTests
{
public
static
function
main
()
...
...
tests/Doctrine/Tests/ORM/Export/ClassExporterTest.php
View file @
68147808
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\Tests\ORM\Export
;
...
...
@@ -25,37 +6,24 @@ use Doctrine\ORM\Export\ClassExporter;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Test case for testing the ddl class exporter
*
* @package Doctrine
* @subpackage Query
* @author Jonathan H. Wage <jonwage@gmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link http://www.doctrine-project.org
* @since 2.0
* @version $Revision$
*/
class
ClassExporterTest
extends
\Doctrine\Tests\OrmTestCase
{
public
function
test
Test
()
public
function
test
GetExportClassesSql
()
{
// DDL is platform dependant. We can inject the platform to test into the driver mock.
$driver
=
new
\Doctrine\Tests\Mocks\DriverMock
;
$conn
=
new
\Doctrine\Tests\Mocks\ConnectionMock
(
array
(),
$driver
);
//$conn->setDatabasePlatform(new \Doctrine\DBAL\Platforms\SqlitePlatform());
$conn
->
setDatabasePlatform
(
new
\Doctrine\DBAL\Platforms\MySqlPlatform
());
$em
=
$this
->
_getTestEntityManager
(
$conn
);
$classes
=
array
(
$em
->
getClassMetadata
(
'Doctrine\Tests\Models\CMS\CmsAddress'
),
$em
->
getClassMetadata
(
'Doctrine\Tests\Models\CMS\CmsUser'
),
$em
->
getClassMetadata
(
'Doctrine\Tests\Models\CMS\CmsPhonenumber'
)
$em
->
getClassMetadata
(
'Doctrine\Tests\Models\CMS\CmsPhonenumber'
)
,
);
$exporter
=
new
ClassExporter
(
$em
);
$sql
=
$exporter
->
getExportClassesSql
(
$classes
);
print_r
(
$sql
);
$this
->
assertEquals
(
count
(
$sql
),
8
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Functional/AllTests.php
View file @
68147808
...
...
@@ -21,8 +21,6 @@ class AllTests
$suite
->
addTestSuite
(
'Doctrine\Tests\ORM\Functional\BasicCRUDTest'
);
//$suite->addTest(Orm_Functional_Ticket_AllTests::suite());
return
$suite
;
}
}
...
...
tests/Doctrine/Tests/ORM/Functional/BasicCRUDTest.php
View file @
68147808
...
...
@@ -10,14 +10,10 @@ use Doctrine\Tests\Models\CMS\CmsGroup;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of BasicCRUDTest
*
* @author robo
*/
class
BasicCRUDTest
extends
\Doctrine\Tests\OrmFunctionalTestCase
{
public
function
testBasicUnitsOfWorkWithOneToManyAssociation
()
{
class
BasicCRUDTest
extends
\Doctrine\Tests\OrmFunctionalTestCase
{
public
function
testBasicUnitsOfWorkWithOneToManyAssociation
()
{
$em
=
$this
->
_em
;
$exporter
=
new
ClassExporter
(
$this
->
_em
);
...
...
@@ -73,7 +69,8 @@ class BasicCRUDTest extends \Doctrine\Tests\OrmFunctionalTestCase {
$this
->
assertFalse
(
$em
->
getUnitOfWork
()
->
isRegisteredRemoved
(
$ph2
));
}
public
function
testOneToManyAssociationModification
()
{
public
function
testOneToManyAssociationModification
()
{
$user
=
new
CmsUser
;
$user
->
name
=
'Roman'
;
$user
->
username
=
'romanb'
;
...
...
@@ -192,4 +189,3 @@ class BasicCRUDTest extends \Doctrine\Tests\OrmFunctionalTestCase {
$this
->
assertEquals
(
0
,
$count
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Functional/Ticket/1Test.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
require_once
'lib/DoctrineTestInit.php'
;
class
Orm_Functional_Ticket_1Test
extends
Doctrine_OrmTestCase
{
public
function
testTest
()
{
$this
->
assertEquals
(
0
,
0
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Functional/Ticket/AllTests.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
define
(
'PHPUnit_MAIN_METHOD'
,
'Orm_Functional_Ticket_AllTests::main'
);
}
require_once
'lib/DoctrineTestInit.php'
;
// Tests
require_once
'Orm/Functional/Ticket/1Test.php'
;
class
Orm_Functional_Ticket_AllTests
{
public
static
function
main
()
{
PHPUnit_TextUI_TestRunner
::
run
(
self
::
suite
());
}
public
static
function
suite
()
{
$suite
=
new
Doctrine_TestSuite
(
'Doctrine Orm'
);
$suite
->
addTestSuite
(
'Orm_Functional_Ticket_1Test'
);
return
$suite
;
}
}
if
(
PHPUnit_MAIN_METHOD
==
'Orm_Functional_Ticket_AllTests::main'
)
{
Ticket_AllTests
::
main
();
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Hydration/AllTests.php
View file @
68147808
tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php
View file @
68147808
...
...
@@ -6,11 +6,6 @@ use Doctrine\Tests\Mocks\HydratorMockStatement;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of ArrayHydratorTest
*
* @author robo
*/
class
ArrayHydratorTest
extends
HydrationTest
{
/**
...
...
@@ -663,7 +658,8 @@ class ArrayHydratorTest extends HydrationTest
$this
->
assertEquals
(
1
,
count
(
$result
[
1
][
'boards'
]));
}
public
function
testResultIteration
()
{
public
function
testResultIteration
()
{
// Faked query components
$queryComponents
=
array
(
'u'
=>
array
(
...
...
@@ -713,4 +709,3 @@ class ArrayHydratorTest extends HydrationTest
}
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Hydration/HydrationTest.php
View file @
68147808
...
...
@@ -4,11 +4,6 @@ namespace Doctrine\Tests\ORM\Hydration;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of HydrationTest
*
* @author robo
*/
class
HydrationTest
extends
\Doctrine\Tests\OrmTestCase
{
protected
$_em
;
...
...
@@ -29,4 +24,3 @@ class HydrationTest extends \Doctrine\Tests\OrmTestCase
return
$parserResult
;
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php
View file @
68147808
...
...
@@ -6,11 +6,6 @@ use Doctrine\Tests\Mocks\HydratorMockStatement;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of ObjectHydratorTest
*
* @author robo
*/
class
ObjectHydratorTest
extends
HydrationTest
{
/**
...
...
@@ -669,7 +664,8 @@ class ObjectHydratorTest extends HydrationTest
}
public
function
testResultIteration
()
{
public
function
testResultIteration
()
{
// Faked query components
$queryComponents
=
array
(
'u'
=>
array
(
...
...
@@ -728,7 +724,7 @@ class ObjectHydratorTest extends HydrationTest
*
* @dataProvider hydrationModeProvider
*/
/*
public function testNewHydrationMixedQueryFetchJoinPerformance()
public
function
testNewHydrationMixedQueryFetchJoinPerformance
()
{
// Faked query components
$queryComponents
=
array
(
...
...
@@ -740,7 +736,7 @@ class ObjectHydratorTest extends HydrationTest
'agg'
=>
array
(
'0'
=>
'nameUpper'
)
),
'p'
=>
array
(
'metadata' => $this->_em->getClassMetadata('CmsPhonenumber'),
'metadata'
=>
$this
->
_em
->
getClassMetadata
(
'
\Doctrine\Tests\Models\CMS\
CmsPhonenumber'
),
'parent'
=>
'u'
,
'relation'
=>
$this
->
_em
->
getClassMetadata
(
'\Doctrine\Tests\Models\CMS\CmsUser'
)
->
getAssociationMapping
(
'phonenumbers'
),
'map'
=>
null
...
...
@@ -775,7 +771,8 @@ class ObjectHydratorTest extends HydrationTest
'p__phonenumber'
=>
'91'
)
);
for ($i=4; $i<300; $i++) {
for
(
$i
=
4
;
$i
<
300
;
$i
++
)
{
$resultSet
[]
=
array
(
'u__id'
=>
$i
,
'u__status'
=>
'developer'
,
...
...
@@ -784,12 +781,10 @@ class ObjectHydratorTest extends HydrationTest
);
}
$stmt = new
Doctrine_
HydratorMockStatement($resultSet);
$hydrator = new
Doctrine_ORM_Internal_Hydration_
ObjectHydrator($this->_em);
$stmt
=
new
HydratorMockStatement
(
$resultSet
);
$hydrator
=
new
\Doctrine\ORM\Internal\Hydration\
ObjectHydrator
(
$this
->
_em
);
$result
=
$hydrator
->
hydrateAll
(
$stmt
,
$this
->
_createParserResult
(
$queryComponents
,
$tableAliasMap
,
true
));
}*/
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php
View file @
68147808
...
...
@@ -6,11 +6,6 @@ use Doctrine\Tests\Mocks\HydratorMockStatement;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of ScalarHydratorTest
*
* @author robo
*/
class
ScalarHydratorTest
extends
HydrationTest
{
/**
...
...
@@ -60,4 +55,3 @@ class ScalarHydratorTest extends HydrationTest
$this
->
assertEquals
(
2
,
$result
[
1
][
'u_id'
]);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php
View file @
68147808
...
...
@@ -6,11 +6,6 @@ use Doctrine\Tests\Mocks\HydratorMockStatement;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of SingleScalarHydratorTest
*
* @author robo
*/
class
SingleScalarHydratorTest
extends
HydrationTest
{
/** Result set provider for the HYDRATE_SINGLE_SCALAR tests */
...
...
@@ -91,7 +86,5 @@ class SingleScalarHydratorTest extends HydrationTest
$this
->
fail
();
}
catch
(
\Doctrine\ORM\Internal\Hydration\HydrationException
$ex
)
{}
}
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Mapping/AllTests.php
View file @
68147808
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php
View file @
68147808
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
namespace
Doctrine\Tests\ORM\Mapping
;
...
...
@@ -12,14 +8,11 @@ use Doctrine\ORM\Mapping\ClassMetadata;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Description of ClassMetadataFactoryTest
*
* @author robo
*/
class
ClassMetadataFactoryTest
extends
\Doctrine\Tests\OrmTestCase
{
class
ClassMetadataFactoryTest
extends
\Doctrine\Tests\OrmTestCase
{
public
function
testGetMetadataForSingleClass
()
{
public
function
testGetMetadataForSingleClass
()
{
$mockPlatform
=
new
DatabasePlatformMock
();
$mockDriver
=
new
MetadataDriverMock
();
...
...
@@ -52,7 +45,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase {
$this
->
assertEquals
(
'table'
,
$cm1
->
getIdGeneratorType
());
}
public
function
testGetMetadataForClassInHierarchy
()
{
public
function
testGetMetadataForClassInHierarchy
()
{
$mockPlatform
=
new
DatabasePlatformMock
();
$mockPlatform
->
setPrefersIdentityColumns
(
true
);
$mockDriver
=
new
MetadataDriverMock
();
...
...
@@ -120,29 +114,39 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase {
}
/* Test subject class with overriden factory method for mocking purposes */
class
ClassMetadataFactoryTestSubject
extends
\Doctrine\ORM\Mapping\ClassMetadataFactory
{
class
ClassMetadataFactoryTestSubject
extends
\Doctrine\ORM\Mapping\ClassMetadataFactory
{
private
$_mockMetadata
=
array
();
private
$_requestedClasses
=
array
();
/** @override */
protected
function
_newClassMetadataInstance
(
$className
)
{
protected
function
_newClassMetadataInstance
(
$className
)
{
$this
->
_requestedClasses
[]
=
$className
;
if
(
!
isset
(
$this
->
_mockMetadata
[
$className
]))
{
throw
new
InvalidArgumentException
(
"No mock metadata found for class
$className
."
);
}
return
$this
->
_mockMetadata
[
$className
];
}
public
function
setMetadataForClass
(
$className
,
$metadata
)
{
public
function
setMetadataForClass
(
$className
,
$metadata
)
{
$this
->
_mockMetadata
[
$className
]
=
$metadata
;
}
public
function
getRequestedClasses
()
{
return
$this
->
_requestedClasses
;
}
public
function
getRequestedClasses
()
{
return
$this
->
_requestedClasses
;
}
}
/* Test classes */
class
TestEntity1
{
class
TestEntity1
{
protected
$name
;
protected
$other
;
}
class
TestEntity2
extends
TestEntity1
{}
class
TestEntity3
extends
TestEntity2
{}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
View file @
68147808
...
...
@@ -8,7 +8,8 @@ require_once __DIR__ . '/../../TestInit.php';
class
ClassMetadataTest
extends
\Doctrine\Tests\OrmTestCase
{
public
function
testClassMetadataInstanceSerialization
()
{
public
function
testClassMetadataInstanceSerialization
()
{
$cm
=
new
ClassMetadata
(
'Doctrine\Tests\Models\CMS\CmsUser'
);
// Test initial state
...
...
tests/Doctrine/Tests/ORM/Performance/AllTests.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
define
(
'PHPUnit_MAIN_METHOD'
,
'Orm_Performance_AllTests::main'
);
}
require_once
'lib/DoctrineTestInit.php'
;
// Tests
//...
class
Orm_Performance_AllTests
{
public
static
function
main
()
{
PHPUnit_TextUI_TestRunner
::
run
(
self
::
suite
());
}
public
static
function
suite
()
{
$suite
=
new
Doctrine_TestSuite
(
'Doctrine Orm Performance'
);
//$suite->addTestSuite('Orm_Performance_xxxTest');
return
$suite
;
}
}
if
(
PHPUnit_MAIN_METHOD
==
'Orm_Performance_AllTests::main'
)
{
Orm_Performance_AllTests
::
main
();
}
tests/Doctrine/Tests/ORM/Query/AllTests.php
View file @
68147808
...
...
@@ -2,22 +2,12 @@
namespace
Doctrine\Tests\ORM\Query
;
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
define
(
'PHPUnit_MAIN_METHOD'
,
'Orm_Query_AllTests::main'
);
}
require_once
__DIR__
.
'/../../TestInit.php'
;
#require_once 'IdentifierRecognitionTest.php';
/*require_once 'ScannerTest.php';
require_once 'DqlGenerationTest.php';
require_once 'DeleteSqlGenerationTest.php';
require_once 'UpdateSqlGenerationTest.php';
require_once 'SelectSqlGenerationTest.php';
require_once 'LanguageRecognitionTest.php';*/
class
AllTests
{
public
static
function
main
()
...
...
@@ -31,8 +21,9 @@ class AllTests
$suite
->
addTestSuite
(
'Doctrine\Tests\ORM\Query\IdentifierRecognitionTest'
);
$suite
->
addTestSuite
(
'Doctrine\Tests\ORM\Query\SelectSqlGenerationTest'
);
/*
$suite->addTestSuite('
Orm_Query_
LanguageRecognitionTest');
$suite->addTestSuite('
Doctrine\Tests\ORM\Query\
LanguageRecognitionTest');
$suite->addTestSuite('Orm_Query_ScannerTest');
$suite->addTestSuite('Orm_Query_DqlGenerationTest');
$suite->addTestSuite('Orm_Query_DeleteSqlGenerationTest');
...
...
tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php
View file @
68147808
This diff is collapsed.
Click to expand it.
tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php
View file @
68147808
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\Tests\ORM\Query
;
require_once
__DIR__
.
'/../../TestInit.php'
;
/**
* Test case for testing the saving and referencing of query identifiers.
*
* @package Doctrine
* @subpackage Query
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Janne Vanhala <jpvanhal@cc.hut.fi>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link http://www.phpdoctrine.org
* @since 2.0
* @version $Revision$
* @todo 1) [romanb] We might want to split the SQL generation tests into multiple
* testcases later since we'll have a lot of them and we might want to have special SQL
* generation tests for some dbms specific SQL syntaxes.
*/
class
SelectSqlGenerationTest
extends
\Doctrine\Tests\OrmTestCase
{
private
$_em
;
protected
function
setUp
()
{
protected
function
setUp
()
{
$this
->
_em
=
$this
->
_getTestEntityManager
();
}
...
...
tests/Doctrine/Tests/ORM/Ticket/1Test.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
require_once
'lib/DoctrineTestInit.php'
;
class
Orm_Ticket_1Test
extends
Doctrine_OrmTestCase
{
public
function
testTest
()
{
$this
->
assertEquals
(
0
,
0
);
}
}
\ No newline at end of file
tests/Doctrine/Tests/ORM/Ticket/AllTests.php
deleted
100644 → 0
View file @
b8b8f85d
<?php
if
(
!
defined
(
'PHPUnit_MAIN_METHOD'
))
{
define
(
'PHPUnit_MAIN_METHOD'
,
'Ticket_AllTests::main'
);
}
require_once
'lib/DoctrineTestInit.php'
;
// Tests
require_once
'Orm/Ticket/1Test.php'
;
class
Orm_Ticket_AllTests
{
public
static
function
main
()
{
PHPUnit_TextUI_TestRunner
::
run
(
self
::
suite
());
}
public
static
function
suite
()
{
$suite
=
new
Doctrine_TestSuite
(
'Doctrine Orm'
);
$suite
->
addTestSuite
(
'Orm_Ticket_1Test'
);
return
$suite
;
}
}
if
(
PHPUnit_MAIN_METHOD
==
'Ticket_AllTests::main'
)
{
Ticket_AllTests
::
main
();
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment