├── tests ├── CliTestCase │ ├── baz.php │ ├── bip.php │ ├── foo.php │ ├── doctrine.php │ ├── CustomDoctrineStyleTask.php │ ├── TaskDeclaredInAnIncFile.inc.php │ ├── testLoadtasksLoadsDoctrineStyleTasksFromTheSpecifiedDirectory │ │ ├── EmptyFile.php │ │ ├── DoctrineStyleTask.php │ │ ├── TaskDeclaredInAnIncFile.inc.php │ │ ├── InvalidClassNameForATask.php │ │ └── should-be-ignored.php │ ├── TestTask02.php │ ├── cli-default.php │ ├── cli-without-autoregistered-custom-tasks.php │ └── cli-with-custom-tasks.php ├── index.php ├── Extension │ └── TestExtension │ │ └── lib │ │ └── Doctrine │ │ ├── Test.php │ │ └── Template │ │ └── TestBehavior.php ├── Ticket │ ├── 1727 │ │ ├── models1 │ │ │ ├── Ticket_1727_Model1.php │ │ │ └── Ticket_1727_Model2.php │ │ └── models2 │ │ │ ├── Ticket_1727_Model3.php │ │ │ └── Ticket_1727_Model4.php │ ├── 2375 │ │ ├── models1 │ │ │ ├── Ticket_2375_Model1.php │ │ │ └── Ticket_2375_Model2.php │ │ └── models2 │ │ │ ├── Ticket_2375_Model3.php │ │ │ ├── Ticket_2375_Model4.php │ │ │ └── Ticket_2375_Model5.php │ ├── DC292 │ │ ├── from.yml │ │ └── to.yml │ ├── DC95 │ │ └── schema.yml │ ├── DC221 │ │ └── TestMigration.php │ ├── 1768TestCase.php │ ├── 1617_schema.yml │ ├── 1783TestCase.php │ ├── 583TestCase.php │ ├── 932TestCase.php │ ├── 697TestCase.php │ ├── 1713TestCase.php │ ├── DC36TestCase.php │ └── 565TestCase.php ├── models │ ├── PluginSymfonyRecordTable.php │ ├── SymfonyRecordTable.php │ ├── ConcreteEmail.php │ ├── ConcreteGroup.php │ ├── GzipTest.php │ ├── DateTest.php │ ├── Log_Status.php │ ├── TestRecord.php │ ├── ConcreteGroupUser.php │ ├── ConcreteUser.php │ ├── MigrationTest.php │ ├── Record_District.php │ ├── Email.php │ ├── EnumTest3.php │ ├── FooLocallyOwned.php │ ├── JC1.php │ ├── JC2.php │ ├── JC3.php │ ├── gnatEmail.php │ ├── BadlyNamed__Class.php │ ├── FilterTest2.php │ ├── Assignment.php │ ├── CustomPK.php │ ├── Description.php │ ├── ResourceReference.php │ ├── UnderscoreColumn.php │ ├── Account.php │ ├── FooForeignlyOwned.php │ ├── QueryTest_Item.php │ ├── SequenceRecord.php │ ├── NotNullTest.php │ ├── Phototag.php │ ├── BaseSymfonyRecord.php │ ├── NestReference.php │ ├── BooleanTest.php │ ├── EnumTest2.php │ ├── ValidatorTest_DateModel.php │ ├── CPK_Association.php │ ├── NestedSetTest_SingleRootNode.php │ ├── Bookmark.php │ ├── CustomSequenceRecord.php │ ├── FooBarRecord.php │ ├── mmrGroupUser_B.php │ ├── EntityAddress.php │ ├── File_Owner.php │ ├── mmrGroupUser_C.php │ ├── QueryTest_UserRank.php │ ├── MysqlGroupMember.php │ ├── ValidatorTest_FootballPlayer.php │ ├── MysqlTestRecord.php │ ├── RTC1.php │ ├── RTC2.php │ ├── TestMovieUserBookmark.php │ ├── SymfonyRecord.php │ ├── ORM_AccessControlsGroups.php │ ├── QueryTest_Subscription.php │ ├── FilterTest.php │ ├── PluginSymfonyRecord.php │ ├── Role.php │ ├── FooForeignlyOwnedWithPK.php │ ├── EntityReference.php │ ├── BlogTag.php │ ├── CheckConstraintTest.php │ ├── Package.php │ ├── TestMovieUserVote.php │ ├── Data_File.php │ ├── I18nTest.php │ ├── Auth.php │ ├── FooReferenceRecord.php │ ├── Rec1.php │ ├── Tag.php │ ├── NestedSet_MultiRootNode.php │ ├── Photo.php │ ├── Record_Country.php │ ├── SelfRefTest.php │ ├── ForeignKeyTest2.php │ ├── BarRecord.php │ ├── BookmarkUser.php │ ├── Log_Entry.php │ ├── RTC4.php │ ├── CategoryWithPosition.php │ ├── CPK_Test.php │ ├── Location.php │ ├── CPK_Test2.php │ ├── SoftDeleteTest.php │ ├── BoardWithPosition.php │ ├── CascadeDeleteTest.php │ ├── M2MTest2.php │ ├── Address.php │ ├── MysqlUser.php │ ├── RecordFilterTest.php │ ├── ValidatorTest_ClientToAddressModel.php │ ├── MysqlGroup.php │ ├── RTC3.php │ ├── NestedSet_Timestampable_MultiRootNode.php │ ├── Page.php │ ├── Rec2.php │ ├── ORM_AccessControl.php │ ├── ORM_AccessGroup.php │ ├── PackageVersionNotes.php │ ├── LocationI18n.php │ ├── Author.php │ ├── SearchTest.php │ ├── MyUser.php │ ├── ORM_TestItem.php │ ├── Error.php │ ├── ConcreteInheritanceTestParent.php │ ├── PolicyCodeN.php │ ├── ValidatorTest_Person.php │ ├── CoverageCodeN.php │ ├── LiabilityCodeN.php │ ├── ResourceType.php │ ├── EnumTest.php │ ├── GroupUser.php │ ├── MyOneThing.php │ ├── MyOtherThing.php │ ├── Song.php │ ├── PackageVersion.php │ ├── SoftDeleteBCTest.php │ ├── gnatUser.php │ ├── mmrGroup_B.php │ ├── mmrGroup_C.php │ ├── Book.php │ ├── Policy.php │ ├── Group.php │ ├── PolicyN.php │ ├── Album.php │ ├── ColumnAliasTest.php │ ├── Forum_Board.php │ ├── CascadeDeleteRelatedTest2.php │ ├── MyUserOneThing.php │ ├── TreeLeaf.php │ ├── App_Category.php │ ├── Forum_Thread.php │ ├── Element.php │ ├── MyUserOtherThing.php │ ├── PolicyAsset.php │ ├── EventListenerTest.php │ ├── InheritanceDeal.php │ ├── mmrUser_B.php │ ├── InheritanceUser.php │ ├── App.php │ ├── EventListenerChainTest.php │ ├── FieldNameTest.php │ ├── mmrUser_C.php │ ├── MysqlIndexTestRecord.php │ ├── Task.php │ ├── Record_City.php │ ├── MyGroup.php │ ├── ORM_TestEntry.php │ ├── Resource.php │ ├── export │ │ ├── Cms_Category.php │ │ └── Cms_CategoryLanguages.php │ ├── RelationTest.php │ ├── MyUserGroup.php │ ├── M2MTest.php │ ├── TestUser.php │ ├── ValidatorTest_ClientModel.php │ ├── App_User.php │ ├── Forum_Entry.php │ ├── Blog.php │ ├── QueryTest_Entry.php │ ├── ValidatorTest.php │ ├── CascadeDeleteRelatedTest.php │ ├── QueryTest_Rank.php │ ├── ForeignKeyTest.php │ ├── Phonenumber.php │ ├── Forum_Category.php │ ├── I18nRelationTest.php │ ├── ValidatorTest_AddressModel.php │ ├── TestMovie.php │ ├── ZeroValueTest.php │ ├── QueryTest_User.php │ ├── RateN.php │ ├── NestTest.php │ ├── VersioningTest.php │ ├── QueryTest_Board.php │ ├── MyUser2.php │ ├── Entity.php │ ├── RecordHookTest.php │ ├── SerializeTest.php │ └── InheritanceDealUser.php ├── RepositoryTestCase.php ├── migration_classes │ ├── 10_test.class.php │ ├── 11_test.class.php │ ├── 5_test.class.php │ ├── 6_test.class.php │ ├── 7_test.class.php │ ├── 8_test.class.php │ ├── 9_test.class.php │ ├── 3_add_profile.class.php │ ├── 2_add_user.class.php │ ├── 4_drop_profile.class.php │ └── 1_add_phonenumber.class.php ├── ModelLoadingTest │ ├── Conservative │ │ ├── ConservativeModelLoadingContact.php │ │ ├── ConservativeModelLoadingProfile.php │ │ ├── BaseConservativeModelLoadingUser.php │ │ └── ConservativeModelLoadingUser.php │ └── Aggressive │ │ ├── MoreModels.php │ │ └── Models.php ├── TaskTestCase │ ├── TestTask004.php │ ├── TestTask005.php │ └── TestTask006.php ├── mysql_migration_classes │ ├── 002_mysql_change_column.php │ └── 001_mysql_add_table.php ├── tmp │ ├── Ticket_1527_User.php │ └── generated │ │ └── BaseTicket_1527_User.php ├── CompositePrimaryKeyTestCase.php ├── Migration │ └── Diff │ │ └── schema │ │ ├── from.yml │ │ └── to.yml ├── Search │ └── _files │ │ ├── content.html │ │ └── content.txt ├── Record │ └── LockTestCase.php ├── bootstrap.php ├── UnsortedTestCase.php ├── unsolved.php ├── DoctrineTest │ └── Reporter │ │ └── Cli.php ├── Query │ └── ShortAliasesTestCase.php ├── template.tpl ├── DataDictTestCase.php ├── Cache │ ├── QuerySqliteTestCase.php │ └── Query │ │ └── SqliteTestCase.php ├── Import │ └── MysqlTestCase.php └── Expression │ ├── MssqlTestCase.php │ ├── MysqlTestCase.php │ ├── PgsqlTestCase.php │ ├── OracleTestCase.php │ └── SqliteTestCase.php ├── .gitignore ├── tools └── sandbox │ ├── doctrine │ ├── index.php │ └── doctrine.php ├── lib └── Doctrine │ ├── Search │ ├── Analyzer │ │ ├── Standard.php │ │ ├── Exception.php │ │ └── Interface.php │ ├── Exception.php │ └── Indexer │ │ └── Exception.php │ ├── Query │ ├── Parser.php │ ├── Registry │ │ └── Exception.php │ └── Exception.php │ ├── Util.php │ ├── I18n │ └── Exception.php │ ├── Pager │ └── Exception.php │ ├── Adapter │ └── Exception.php │ ├── Cli │ └── Exception.php │ ├── Node │ └── Exception.php │ ├── Task │ └── Exception.php │ ├── Data │ └── Exception.php │ ├── Record │ └── Exception.php │ ├── Relation │ └── Parser │ │ └── Exception.php │ ├── Tree │ └── Exception.php │ ├── View │ └── Exception.php │ ├── Parser │ └── Exception.php │ ├── Export │ └── Exception.php │ ├── Manager │ └── Exception.php │ ├── RawSql │ └── Exception.php │ ├── Compiler │ └── Exception.php │ ├── DataDict │ └── Exception.php │ ├── Expression │ └── Mock.php │ └── Hydrator │ └── Exception.php ├── composer.json └── COPYRIGHT /tests/CliTestCase/baz.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/CliTestCase/bip.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/CliTestCase/foo.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/CliTestCase/doctrine.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/CliTestCase/CustomDoctrineStyleTask.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tests/DoctrineTest/doctrine_tests/* 2 | -------------------------------------------------------------------------------- /tests/CliTestCase/TaskDeclaredInAnIncFile.inc.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/index.php: -------------------------------------------------------------------------------- 1 | actAs('EmailTemplate'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/models/ConcreteGroup.php: -------------------------------------------------------------------------------- 1 | actAs('GroupTemplate'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/models/GzipTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('gzip', 'gzip', 100000); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/models/DateTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('date', 'date', 20); 5 | } 6 | } 7 | 8 | -------------------------------------------------------------------------------- /tests/models/Log_Status.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/models/TestRecord.php: -------------------------------------------------------------------------------- 1 | setTableName('test'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/models/ConcreteGroupUser.php: -------------------------------------------------------------------------------- 1 | actAs('GroupUserTemplate'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/models/ConcreteUser.php: -------------------------------------------------------------------------------- 1 | actAs('UserTemplate'); 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/models/MigrationTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('field1', 'string'); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/models/Record_District.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/models/Email.php: -------------------------------------------------------------------------------- 1 | hasColumn('address', 'string', 150, 'email|unique'); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/models/EnumTest3.php: -------------------------------------------------------------------------------- 1 | hasColumn('text', 'string', 10, array('primary' => true)); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/ModelLoadingTest/Conservative/ConservativeModelLoadingContact.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/Ticket/1727/models1/Ticket_1727_Model2.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/Ticket/1727/models2/Ticket_1727_Model3.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/Ticket/1727/models2/Ticket_1727_Model4.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/Ticket/2375/models1/Ticket_2375_Model1.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/Ticket/2375/models2/Ticket_2375_Model3.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | } -------------------------------------------------------------------------------- /tests/models/FooLocallyOwned.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/models/JC1.php: -------------------------------------------------------------------------------- 1 | hasColumn('c1_id', 'integer'); 5 | $this->hasColumn('c2_id', 'integer'); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/models/JC2.php: -------------------------------------------------------------------------------- 1 | hasColumn('c1_id', 'integer'); 5 | $this->hasColumn('c2_id', 'integer'); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/models/JC3.php: -------------------------------------------------------------------------------- 1 | hasColumn('c1_id', 'integer'); 5 | $this->hasColumn('c2_id', 'integer'); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/ModelLoadingTest/Conservative/BaseConservativeModelLoadingUser.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 8 | } 9 | } -------------------------------------------------------------------------------- /tests/Ticket/2375/models2/Ticket_2375_Model4.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 8 | } 9 | } -------------------------------------------------------------------------------- /tests/models/gnatEmail.php: -------------------------------------------------------------------------------- 1 | hasColumn('address', 'string', 150); 7 | } 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/BadlyNamed__Class.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string',100); 5 | $this->hasColumn('test1_id', 'integer'); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/Assignment.php: -------------------------------------------------------------------------------- 1 | hasColumn('task_id', 'integer'); 5 | $this->hasColumn('resource_id', 'integer'); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/models/CustomPK.php: -------------------------------------------------------------------------------- 1 | hasColumn('uid', 'integer',11, 'autoincrement|primary'); 5 | $this->hasColumn('name', 'string',255); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/Description.php: -------------------------------------------------------------------------------- 1 | hasColumn('description', 'string',3000); 5 | $this->hasColumn('file_md5', 'string',32); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/models/ResourceReference.php: -------------------------------------------------------------------------------- 1 | hasColumn('type_id', 'integer'); 5 | $this->hasColumn('resource_id', 'integer'); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/models/UnderscoreColumn.php: -------------------------------------------------------------------------------- 1 | setTableName('_test_'); 7 | $this->hasColumn('_underscore_', 'string', 255); 8 | } 9 | } -------------------------------------------------------------------------------- /tests/Extension/TestExtension/lib/Doctrine/Template/TestBehavior.php: -------------------------------------------------------------------------------- 1 | hasColumn('test', 'string', 255); 8 | } 9 | } -------------------------------------------------------------------------------- /tests/models/Account.php: -------------------------------------------------------------------------------- 1 | hasColumn('entity_id', 'integer'); 7 | $this->hasColumn('amount', 'integer'); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/CliTestCase/testLoadtasksLoadsDoctrineStyleTasksFromTheSpecifiedDirectory/EmptyFile.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | //This empty file shouldn't cause any problems for the CLI -------------------------------------------------------------------------------- /tests/CliTestCase/TestTask02.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Cli_TestCase_TestTask02 extends Doctrine_Task 9 | { 10 | public function execute() {} 11 | } -------------------------------------------------------------------------------- /tests/models/FooForeignlyOwned.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 7 | $this->hasColumn('fooId', 'integer'); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/QueryTest_Item.php: -------------------------------------------------------------------------------- 1 | hasColumn('price', 'decimal'); 7 | $this->hasColumn('quantity', 'integer'); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/models/SequenceRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', null, array('primary', 'sequence')); 6 | $this->hasColumn('name', 'string'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/models/NotNullTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 100, 'notnull'); 5 | $this->hasColumn('type', 'integer', 11); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/Phototag.php: -------------------------------------------------------------------------------- 1 | hasColumn('photo_id', 'integer', 11, array('primary' => true)); 5 | $this->hasColumn('tag_id', 'integer', 11, array('primary' => true)); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/BaseSymfonyRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 30); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/NestReference.php: -------------------------------------------------------------------------------- 1 | hasColumn('parent_id', 'integer', 4, 'primary'); 7 | $this->hasColumn('child_id', 'integer', 4, 'primary'); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/ModelLoadingTest/Conservative/ConservativeModelLoadingUser.php: -------------------------------------------------------------------------------- 1 | hasColumn('is_working', 'boolean'); 5 | $this->hasColumn('is_working_notnull', 'boolean', 1, array('default' => false, 'notnull' => true)); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/EnumTest2.php: -------------------------------------------------------------------------------- 1 | hasColumn('status', 'enum', 11, array('values' => array('open', 'verified', 'closed'))); 6 | $this->hasColumn('enum_test_id', 'integer'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/models/ValidatorTest_DateModel.php: -------------------------------------------------------------------------------- 1 | hasColumn('birthday', 'date', null, array('past')); 5 | $this->hasColumn('death', 'date', null, array('future')); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/CPK_Association.php: -------------------------------------------------------------------------------- 1 | hasColumn('test1_id', 'integer', 11, array('primary' => true)); 5 | $this->hasColumn('test2_id', 'integer', 11, array('primary' => true)); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/models/NestedSetTest_SingleRootNode.php: -------------------------------------------------------------------------------- 1 | actAs('NestedSet'); 6 | $this->hasColumn('name', 'string', 50, array('notnull')); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/Bookmark.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'integer', null, array('primary' => true)); 7 | $this->hasColumn('page_id', 'integer', null, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/CustomSequenceRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', null, array('primary', 'sequence' => 'custom_seq')); 6 | $this->hasColumn('name', 'string'); 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/models/FooBarRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('fooId', 'integer', null, array('primary' => true)); 7 | $this->hasColumn('barId', 'integer', null, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/mmrGroupUser_B.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'string', 30, array('primary' => true)); 7 | $this->hasColumn('group_id', 'string', 30, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/TaskTestCase/TestTask004.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Task_TestCase_TestTask004 extends Doctrine_Task 9 | { 10 | public $taskName = '-invalid-task-name'; 11 | 12 | public function execute() {} 13 | } -------------------------------------------------------------------------------- /tests/models/EntityAddress.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'integer', null, array('primary' => true)); 7 | $this->hasColumn('address_id', 'integer', null, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/File_Owner.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 5 | } 6 | public function setUp() { 7 | $this->hasOne('Data_File', array('local' => 'id', 'foreign' => 'file_owner_id')); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/mmrGroupUser_C.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'string', 30, array('primary' => true)); 8 | $this->hasColumn('group_id', 'string', 30, array('primary' => true)); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/CliTestCase/testLoadtasksLoadsDoctrineStyleTasksFromTheSpecifiedDirectory/DoctrineStyleTask.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Task_DoctrineStyleTask extends Doctrine_Task 9 | { 10 | public function execute() {} 11 | } -------------------------------------------------------------------------------- /tests/TaskTestCase/TestTask005.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Task_TestCase_TestTask005 extends Doctrine_Task 9 | { 10 | public $taskName = 'another invalid task name'; 11 | 12 | public function execute() {} 13 | } -------------------------------------------------------------------------------- /tests/models/QueryTest_UserRank.php: -------------------------------------------------------------------------------- 1 | hasColumn('rankId', 'integer', 4, array('primary' => true)); 7 | $this->hasColumn('userId', 'integer', 4, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/MysqlGroupMember.php: -------------------------------------------------------------------------------- 1 | hasColumn('group_id', 'integer', null, array('primary' => true)); 7 | $this->hasColumn('user_id', 'integer', null, array('primary' => true)); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/models/ValidatorTest_FootballPlayer.php: -------------------------------------------------------------------------------- 1 | hasColumn('person_id', 'string', 255); 5 | $this->hasColumn('team_name', 'string', 255); 6 | $this->hasColumn('goals_count', 'integer', 4); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/CliTestCase/testLoadtasksLoadsDoctrineStyleTasksFromTheSpecifiedDirectory/TaskDeclaredInAnIncFile.inc.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Task_TaskDeclaredInAnIncFile extends Doctrine_Task 9 | { 10 | public function execute() {} 11 | } -------------------------------------------------------------------------------- /tests/models/MysqlTestRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null, 'primary'); 7 | $this->hasColumn('code', 'integer', null, 'primary'); 8 | 9 | $this->option('type', 'INNODB'); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/models/RTC1.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | } 6 | public function setUp() { 7 | $this->hasMany('M2MTest as RTC1', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC1')); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/models/RTC2.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | } 6 | public function setUp() { 7 | $this->hasMany('M2MTest as RTC2', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC1')); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/models/TestMovieUserBookmark.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'integer', null, array('primary' => true)); 7 | $this->hasColumn('movie_id', 'integer', null, array('primary' => true)); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/models/SymfonyRecord.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Cli_TestCase_InvalidClassNameForATask extends Doctrine_Task 9 | { 10 | public function execute() {} 11 | } -------------------------------------------------------------------------------- /tests/models/ORM_AccessControlsGroups.php: -------------------------------------------------------------------------------- 1 | hasColumn('accessControlID', 'integer', 11, array('primary' => true)); 7 | $this->hasColumn('accessGroupID', 'integer', 11, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/QueryTest_Subscription.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', 4, array('primary', 'autoincrement', 'notnull')); 6 | $this->hasColumn('begin', 'date'); 7 | $this->hasColumn('end', 'date'); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/ModelLoadingTest/Aggressive/MoreModels.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string',100); 5 | } 6 | public function setUp() { 7 | $this->hasMany('FilterTest2 as filtered', array('local' => 'id', 'foreign' => 'test1_id', 'onDelete' => 'CASCADE')); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/PluginSymfonyRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 20, array('unique' => true)); 7 | } 8 | public function setUp() 9 | { 10 | $this->hasMany('Auth', array('local' => 'id', 'foreign' => 'roleid')); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/models/FooForeignlyOwnedWithPK.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 7 | } 8 | public function setUp() 9 | { 10 | $this->hasOne('FooRecord', array('local' => 'id', 'foreign' => 'id')); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/models/EntityReference.php: -------------------------------------------------------------------------------- 1 | hasColumn('entity1', 'integer', null, 'primary'); 7 | $this->hasColumn('entity2', 'integer', null, 'primary'); 8 | //$this->setPrimaryKey(array('entity1', 'entity2')); 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/mysql_migration_classes/002_mysql_change_column.php: -------------------------------------------------------------------------------- 1 | renameColumn('migration_test','field2','field3'); 7 | } 8 | 9 | public function down() 10 | { 11 | $this->renameColumn('migration_test','field3','field2'); 12 | } 13 | } -------------------------------------------------------------------------------- /tests/models/BlogTag.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 100); 7 | $this->hasColumn('description', 'string'); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('Blog', array('onDelete' => 'CASCADE')); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/CheckConstraintTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('price', 'decimal', 2, array('max' => 5000, 'min' => 100)); 7 | $this->hasColumn('discounted_price', 'decimal', 2); 8 | $this->check('price > discounted_price'); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/CliTestCase/testLoadtasksLoadsDoctrineStyleTasksFromTheSpecifiedDirectory/should-be-ignored.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | This file should be ignored because its filename starts with a lowercase letter. You shouldn't, therefore, see any 9 | syntax errors when running Doctrine_Cli_TestCase. -------------------------------------------------------------------------------- /tests/ModelLoadingTest/Aggressive/Models.php: -------------------------------------------------------------------------------- 1 | hasColumn('description', 'string', 255); 5 | } 6 | 7 | public function setUp() 8 | { 9 | $this->hasMany('PackageVersion as Version', array('local' => 'id', 'foreign' => 'package_id', 'onDelete' => 'CASCADE')); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/models/TestMovieUserVote.php: -------------------------------------------------------------------------------- 1 | hasColumn('vote', 'string', 30); 6 | $this->hasColumn('user_id', 'integer', null, array('primary' => true)); 7 | $this->hasColumn('movie_id', 'integer', null, array('primary' => true)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/models/Data_File.php: -------------------------------------------------------------------------------- 1 | hasColumn('filename', 'string'); 5 | $this->hasColumn('file_owner_id', 'integer'); 6 | } 7 | public function setUp() { 8 | $this->hasOne('File_Owner', array('local' => 'file_owner_id', 'foreign' => 'id')); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/I18nTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 7 | $this->hasColumn('title', 'string', 200); 8 | } 9 | public function setUp() 10 | { 11 | $this->actAs('I18n', array('fields' => array('name', 'title'))); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/TaskTestCase/TestTask006.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | class Doctrine_Task_TestCase_TestTask006 extends Doctrine_Task 9 | { 10 | public function __construct() 11 | { 12 | $this->setTaskName('invalid_task_name'); 13 | } 14 | 15 | public function execute() {} 16 | } -------------------------------------------------------------------------------- /tests/models/Auth.php: -------------------------------------------------------------------------------- 1 | hasColumn('roleid', 'integer', 10); 7 | $this->hasColumn('name', 'string', 50); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('Role', array('local' => 'roleid', 'foreign' => 'id')); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/models/FooReferenceRecord.php: -------------------------------------------------------------------------------- 1 | setTableName('foo_reference'); 7 | 8 | $this->hasColumn('foo1', 'integer', null, array('primary' => true)); 9 | $this->hasColumn('foo2', 'integer', null, array('primary' => true)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/models/Rec1.php: -------------------------------------------------------------------------------- 1 | hasColumn('first_name', 'string', 128, array ()); 7 | } 8 | 9 | public function setUp() 10 | { 11 | $this->hasOne('Rec2 as Account', array('local' => 'id', 'foreign' => 'user_id', 'onDelete' => 'CASCADE')); 12 | } 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/models/Tag.php: -------------------------------------------------------------------------------- 1 | hasMany('Photo', array( 5 | 'local' => 'tag_id', 6 | 'foreign' => 'photo_id', 7 | 'refClass' => 'Phototag' 8 | )); 9 | } 10 | public function setTableDefinition() { 11 | $this->hasColumn('tag', 'string', 100); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/NestedSet_MultiRootNode.php: -------------------------------------------------------------------------------- 1 | actAs('NestedSet', array('hasManyRoots' => true, 'rootColumnName' => 'root_id')); 6 | $this->hasColumn('name', 'string', 50, array('notnull')); 7 | $this->hasColumn('root_id', 'integer', 4); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/Photo.php: -------------------------------------------------------------------------------- 1 | hasMany('Tag', array( 5 | 'local' => 'photo_id', 6 | 'foreign' => 'tag_id', 7 | 'refClass' => 'Phototag' 8 | )); 9 | } 10 | public function setTableDefinition() { 11 | $this->hasColumn('name', 'string', 100); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/Record_Country.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | } 6 | public function setUp() { 7 | $this->hasMany('Record_City as City', array( 8 | 'local' => 'id', 9 | 'foreign' => 'country_id' 10 | )); 11 | } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/models/SelfRefTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 50); 7 | $this->hasColumn('created_by', 'integer'); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('SelfRefTest as createdBy', array('local' => 'created_by')); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/models/ForeignKeyTest2.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null); 7 | $this->hasColumn('foreignkey', 'integer'); 8 | 9 | $this->hasOne('ForeignKeyTest', array( 10 | 'local' => 'foreignKey', 'foreign' => 'id' 11 | )); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/BarRecord.php: -------------------------------------------------------------------------------- 1 | setTableName('bar'); 7 | $this->hasColumn('name', 'string', 200); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasMany('FooRecord as Foo', array('local' => 'barId', 'foreign' => 'fooId', 'refClass' => 'FooBarRecord')); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/tmp/Ticket_1527_User.php: -------------------------------------------------------------------------------- 1 | 11 | * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ 12 | */ 13 | class Ticket_1527_User extends BaseTicket_1527_User 14 | { 15 | 16 | } -------------------------------------------------------------------------------- /tests/models/BookmarkUser.php: -------------------------------------------------------------------------------- 1 | hasMany('Bookmark as Bookmarks', 7 | array('local' => 'id', 8 | 'foreign' => 'user_id')); 9 | } 10 | public function setTableDefinition() 11 | { 12 | $this->hasColumn('name', 'string', 30); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/Log_Entry.php: -------------------------------------------------------------------------------- 1 | hasColumn('stamp', 'timestamp'); 5 | $this->hasColumn('status_id', 'integer'); 6 | } 7 | 8 | public function setUp() { 9 | $this->hasOne('Log_Status', array( 10 | 'local' => 'status_id', 'foreign' => 'id' 11 | )); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/RTC4.php: -------------------------------------------------------------------------------- 1 | hasColumn('oid', 'integer', 11, array('autoincrement', 'primary')); 5 | $this->hasColumn('name', 'string', 20); 6 | } 7 | public function setUp() { 8 | $this->hasMany('M2MTest2', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC3')); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/Ticket/2375/models2/Ticket_2375_Model5.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 8 | } 9 | } 10 | 11 | class Ticket_2375_Model6 extends Doctrine_Record 12 | { 13 | public function setTableDefinition() 14 | { 15 | $this->hasColumn('name', 'string', 255); 16 | } 17 | } -------------------------------------------------------------------------------- /tests/models/CategoryWithPosition.php: -------------------------------------------------------------------------------- 1 | hasColumn('position', 'integer'); 5 | $this->hasColumn('name', 'string', 255); 6 | } 7 | public function setUp() { 8 | $this->hasMany('BoardWithPosition as Boards', array('local' => 'id' , 'foreign' => 'category_id')); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/CliTestCase/cli-default.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | require_once(dirname(dirname(dirname(__FILE__))) . '/lib/Doctrine.php'); 9 | spl_autoload_register(array('Doctrine', 'autoload')); 10 | 11 | require_once(dirname(__FILE__) . '/TestTask02.php'); 12 | 13 | $cli = new Doctrine_Cli(); 14 | $cli->run($_SERVER['argv']); -------------------------------------------------------------------------------- /tests/models/CPK_Test.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 5 | } 6 | public function setUp() { 7 | $this->hasMany('CPK_Test2 as Test', array( 8 | 'local' => 'test1_id', 9 | 'foreign' => 'test2_id', 10 | 'refClass' => 'CPK_Association' 11 | )); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/Location.php: -------------------------------------------------------------------------------- 1 | hasColumn('lat', 'double', 10, array ()); 7 | $this->hasColumn('lon', 'double', 10, array ()); 8 | } 9 | 10 | public function setUp() 11 | { 12 | $this->hasMany('LocationI18n as LocationI18n', array('local' => 'id', 'foreign' => 'id')); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/CPK_Test2.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 5 | } 6 | public function setUp() { 7 | $this->hasMany('CPK_Test as Test', array( 8 | 'local' => 'test2_id', 9 | 'foreign' => 'test1_id', 10 | 'refClass' => 'CPK_Association' 11 | )); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/SoftDeleteTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null, array('primary' => true)); 7 | $this->hasColumn('something', 'string', '25', array('notnull' => true, 'unique' => true)); 8 | } 9 | 10 | public function setUp() 11 | { 12 | $this->actAs('SoftDelete'); 13 | } 14 | } -------------------------------------------------------------------------------- /tests/mysql_migration_classes/001_mysql_add_table.php: -------------------------------------------------------------------------------- 1 | createTable('migration_test', array('field1' => array('type' => 'string'))); 7 | $this->addColumn('migration_test', 'field2', 'integer'); 8 | } 9 | 10 | public function down() 11 | { 12 | $this->dropTable('migration_test'); 13 | } 14 | } -------------------------------------------------------------------------------- /tests/models/BoardWithPosition.php: -------------------------------------------------------------------------------- 1 | hasColumn('position', 'integer'); 5 | $this->hasColumn('category_id', 'integer'); 6 | } 7 | public function setUp() { 8 | $this->hasOne('CategoryWithPosition as Category', array('local' => 'category_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/CascadeDeleteTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | } 8 | public function setUp() 9 | { 10 | $this->hasMany('CascadeDeleteRelatedTest as Related', 11 | array('local' => 'id', 12 | 'foreign' => 'cscd_id')); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/CompositePrimaryKeyTestCase.php: -------------------------------------------------------------------------------- 1 | tables = array(); 7 | $this->tables[] = "CPK_Test"; 8 | $this->tables[] = "CPK_Test2"; 9 | $this->tables[] = "CPK_Association"; 10 | 11 | parent::prepareTables(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/M2MTest2.php: -------------------------------------------------------------------------------- 1 | hasColumn('oid', 'integer', 11, array('autoincrement' => true, 'primary' => true)); 5 | $this->hasColumn('name', 'string', 20); 6 | } 7 | public function setUp() { 8 | $this->hasMany('RTC4 as RTC5', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC3')); 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/models/Address.php: -------------------------------------------------------------------------------- 1 | hasMany('User', array('local' => 'address_id', 7 | 'foreign' => 'user_id', 8 | 'refClass' => 'EntityAddress')); 9 | } 10 | public function setTableDefinition() { 11 | $this->hasColumn('address', 'string', 200); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/MysqlUser.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null); 7 | } 8 | 9 | public function setUp() 10 | { 11 | $this->hasMany('MysqlGroup', array( 12 | 'local' => 'user_id', 13 | 'foreign' => 'group_id', 14 | 'refClass' => 'MysqlGroupMember' 15 | )); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/models/RecordFilterTest.php: -------------------------------------------------------------------------------- 1 | hasColumn("name", "string", 200); 8 | $this->hasColumn("password", "string", 32); 9 | } 10 | public function setPassword($password) { 11 | return md5($password); 12 | } 13 | public function getName($name) { 14 | return strtoupper($name); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/ValidatorTest_ClientToAddressModel.php: -------------------------------------------------------------------------------- 1 | hasColumn("client_id", "integer", 11, array('primary' => true)); 7 | $this->hasColumn("address_id", "integer", 11, array('primary' => true)); 8 | } 9 | 10 | public function construct() 11 | { 12 | 13 | } 14 | 15 | public function setUp() 16 | { 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /tests/models/MysqlGroup.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null); 7 | } 8 | 9 | public function setUp() 10 | { 11 | $this->hasMany('MysqlUser', array( 12 | 'local' => 'group_id', 13 | 'foreign' => 'user_id', 14 | 'refClass' => 'MysqlGroupMember' 15 | )); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/models/RTC3.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | } 6 | public function setUp() { 7 | $this->hasMany('M2MTest as RTC3', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC2')); 8 | $this->hasMany('M2MTest as RTC4', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC1')); 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/models/NestedSet_Timestampable_MultiRootNode.php: -------------------------------------------------------------------------------- 1 | actAs('NestedSet', array('hasManyRoots' => true, 'rootColumnName' => 'root_id')); 6 | $this->actAs('Timestampable'); 7 | $this->hasColumn('name', 'string', 50, array('notnull')); 8 | $this->hasColumn('root_id', 'integer', 4); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/models/Page.php: -------------------------------------------------------------------------------- 1 | hasMany('Bookmark as Bookmarks', 8 | array('local' => 'id', 9 | 'foreign' => 'page_id')); 10 | } 11 | 12 | public function setTableDefinition() 13 | { 14 | $this->hasColumn('name', 'string', 30); 15 | $this->hasColumn('url', 'string', 100); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/models/Rec2.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'integer', 10, array ( 'unique' => true,)); 7 | $this->hasColumn('address', 'string', 150, array ()); 8 | } 9 | 10 | public function setUp() 11 | { 12 | $this->hasOne('Rec1 as User', array('local' => 'id', 'foreign' => 'user_id', 'onDelete' => 'CASCADE')); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/ORM_AccessControl.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | public function setUp() 9 | { 10 | $this->hasMany('ORM_AccessGroup as accessGroups', array( 11 | 'local' => 'accessControlID', 'foreign' => 'accessGroupID', 'refClass' => 'ORM_AccessControlsGroups' 12 | )); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/ORM_AccessGroup.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 255); 7 | } 8 | public function setUp() 9 | { 10 | $this->hasMany('ORM_AccessControl as accessControls', array( 11 | 'local' => 'accessGroupID', 'foreign' => 'accessControlID', 'refClass' => 'ORM_AccessControlsGroups' 12 | )); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/PackageVersionNotes.php: -------------------------------------------------------------------------------- 1 | hasColumn('package_version_id', 'integer'); 7 | $this->hasColumn('description', 'string', 255); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('PackageVersion', array( 12 | 'local' => 'package_version_id', 'foreign' => 'id' 13 | )); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/LocationI18n.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 50, array()); 7 | $this->hasColumn('id', 'integer', 10, array('primary' => true)); 8 | $this->hasColumn('culture', 'string', 2); 9 | } 10 | 11 | public function setUp() 12 | { 13 | $this->hasOne('Location as Location', array('local' => 'id')); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/Author.php: -------------------------------------------------------------------------------- 1 | hasOne('Book', array('local' => 'book_id', 7 | 'foreign' => 'id', 8 | 'onDelete' => 'CASCADE')); 9 | } 10 | public function setTableDefinition() 11 | { 12 | $this->hasColumn('book_id', 'integer'); 13 | $this->hasColumn('name', 'string',20); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/SearchTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('title', 'string', 100); 7 | $this->hasColumn('content', 'string'); 8 | } 9 | public function setUp() 10 | { 11 | $options = array('generateFiles' => false, 12 | 'fields' => array('title', 'content')); 13 | 14 | $this->actAs('Searchable', $options); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/MyUser.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | } 8 | 9 | public function setUp() 10 | { 11 | $this->hasMany('MyOneThing', array( 12 | 'local' => 'id', 'foreign' => 'user_id' 13 | )); 14 | 15 | $this->hasMany('MyOtherThing', array( 16 | 'local' => 'id', 'foreign' => 'user_id' 17 | )); 18 | } 19 | } -------------------------------------------------------------------------------- /tests/models/ORM_TestItem.php: -------------------------------------------------------------------------------- 1 | setTableName('test_items'); 5 | $this->hasColumn('id', 'integer', 11, 'autoincrement|primary'); 6 | $this->hasColumn('name', 'string', 255); 7 | } 8 | 9 | public function setUp() { 10 | 11 | $this->hasOne('ORM_TestEntry', array( 12 | 'local' => 'id', 'foreign' => 'itemID' 13 | )); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/CliTestCase/cli-without-autoregistered-custom-tasks.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | require_once(dirname(dirname(dirname(__FILE__))) . '/lib/Doctrine.php'); 9 | spl_autoload_register(array('Doctrine', 'autoload')); 10 | 11 | require_once(dirname(__FILE__) . '/TestTask02.php'); 12 | 13 | $cli = new Doctrine_Cli(array('autoregister_custom_tasks' => false)); 14 | $cli->run($_SERVER['argv']); -------------------------------------------------------------------------------- /tests/models/Error.php: -------------------------------------------------------------------------------- 1 | hasMany('Description', array('local' => 'file_md5', 5 | 'foreign' => 'file_md5')); 6 | } 7 | public function setTableDefinition() { 8 | $this->hasColumn('message', 'string',200); 9 | $this->hasColumn('code', 'integer',11); 10 | $this->hasColumn('file_md5', 'string',32, 'primary'); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/models/ConcreteInheritanceTestParent.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | } 8 | } 9 | 10 | class ConcreteInheritanceTestChild extends ConcreteInheritanceTestParent 11 | { 12 | public function setTableDefinition() 13 | { 14 | $this->hasColumn('age', 'integer'); 15 | 16 | parent::setTableDefinition(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/PolicyCodeN.php: -------------------------------------------------------------------------------- 1 | setTableName('policy_codes'); 7 | $this->hasColumn('id', 'integer', 4, array('notnull' => true, 'primary' => true, 'autoincrement' => true)); 8 | $this->hasColumn('code', 'integer', 4, array ( 'notnull' => true, 'notblank' => true,)); 9 | $this->hasColumn('description', 'string', 4000, array ( 'notnull' => true, 'notblank' => true,)); 10 | } 11 | } -------------------------------------------------------------------------------- /tests/models/ValidatorTest_Person.php: -------------------------------------------------------------------------------- 1 | hasColumn('identifier', 'integer', 4, array('notblank', 'unique')); 5 | $this->hasColumn('is_football_player', 'boolean'); 6 | } 7 | 8 | public function setUp() { 9 | $this->hasOne('ValidatorTest_FootballPlayer', array( 10 | 'local' => 'id', 'foreign' => 'person_id', 'onDelete' => 'CASCADE' 11 | )); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/CoverageCodeN.php: -------------------------------------------------------------------------------- 1 | setTableName('coverage_codes'); 7 | $this->hasColumn('id', 'integer', 4, array('notnull' => true, 'primary' => true, 'autoincrement' => true)); 8 | $this->hasColumn('code', 'integer', 4, array ( 'notnull' => true, 'notblank' => true,)); 9 | $this->hasColumn('description', 'string', 4000, array ( 'notnull' => true, 'notblank' => true,)); 10 | } 11 | } -------------------------------------------------------------------------------- /tests/models/LiabilityCodeN.php: -------------------------------------------------------------------------------- 1 | setTableName('liability_codes'); 7 | $this->hasColumn('id', 'integer', 4, array('notnull' => true, 'primary' => true, 'autoincrement' => true)); 8 | $this->hasColumn('code', 'integer', 4, array ( 'notnull' => true, 'notblank' => true,)); 9 | $this->hasColumn('description', 'string', 4000, array ( 'notnull' => true, 'notblank' => true,)); 10 | } 11 | } -------------------------------------------------------------------------------- /tests/models/ResourceType.php: -------------------------------------------------------------------------------- 1 | hasMany('Resource as ResourceAlias', array('local' => 'type_id', 5 | 'foreign' => 'resource_id', 6 | 'refClass' => 'ResourceReference')); 7 | } 8 | public function setTableDefinition() { 9 | $this->hasColumn('type', 'string',100); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/migration_classes/3_add_profile.class.php: -------------------------------------------------------------------------------- 1 | table($direction, 'migration_profile', array('id' => array('type' => 'integer', 'length' => 20, 'autoincrement' => true, 'primary' => true), 'name' => array('type' => 'string', 'length' => 255)), array('indexes' => array(), 'primary' => array(0 => 'id'))); 10 | } 11 | } -------------------------------------------------------------------------------- /tests/models/EnumTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('status', 'enum', 11, array('values' => array('open', 'verified', 'closed'))); 6 | $this->hasColumn('text', 'string'); 7 | } 8 | public function setUp() { 9 | $this->hasMany('EnumTest2 as Enum2', array('local' => 'id', 'foreign' => 'enum_test_id')); 10 | $this->hasMany('EnumTest3 as Enum3', array('local' => 'text', 'foreign' => 'text')); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/models/GroupUser.php: -------------------------------------------------------------------------------- 1 | hasColumn('added', 'integer'); 7 | $this->hasColumn('group_id', 'integer'); 8 | $this->hasColumn('user_id', 'integer'); 9 | } 10 | 11 | public function setUp() 12 | { 13 | $this->hasOne('Group', array('local' => 'group_id', 'foreign' => 'id')); 14 | $this->hasOne('User', array('local' => 'user_id', 'foreign' => 'id')); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/MyOneThing.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 5 | $this->hasColumn('user_id', 'integer'); 6 | } 7 | 8 | public function setUp() { 9 | $this->hasMany('MyUserOneThing', array( 10 | 'local' => 'id', 'foreign' => 'one_thing_id' 11 | )); 12 | 13 | $this->hasOne('MyUser', array( 14 | 'local' => 'user_id', 'foreign' => 'id' 15 | )); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/models/MyOtherThing.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 5 | $this->hasColumn('user_id', 'integer'); 6 | } 7 | public function setUp() { 8 | $this->hasMany('MyUserOtherThing', array( 9 | 'local' => 'id', 'foreign' => 'other_thing_id' 10 | )); 11 | 12 | $this->hasOne('MyUser', array( 13 | 'local' => 'user_id', 'foreign' => 'id' 14 | )); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/Song.php: -------------------------------------------------------------------------------- 1 | hasOne('Album', array('local' => 'album_id', 7 | 'foreign' => 'id', 8 | 'onDelete' => 'CASCADE')); 9 | } 10 | public function setTableDefinition() 11 | { 12 | $this->hasColumn('album_id', 'integer'); 13 | $this->hasColumn('genre', 'string',20); 14 | $this->hasColumn('title', 'string',30); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/PackageVersion.php: -------------------------------------------------------------------------------- 1 | hasColumn('package_id', 'integer'); 5 | $this->hasColumn('description', 'string', 255); 6 | } 7 | public function setUp() 8 | { 9 | $this->hasOne('Package', array('local' => 'package_id', 'foreign' => 'id')); 10 | $this->hasMany('PackageVersionNotes as Note', array( 11 | 'local' => 'id', 'foreign' => 'package_version_id' 12 | )); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/SoftDeleteBCTest.php: -------------------------------------------------------------------------------- 1 | setTableName('soft_delete_bc_test'); 7 | 8 | $this->hasColumn('name', 'string', null, array('primary' => true)); 9 | $this->hasColumn('something', 'string', '25', array('notnull' => true, 'unique' => true)); 10 | } 11 | 12 | public function setUp() 13 | { 14 | $this->actAs('SoftDelete', array('name' => 'deleted', 'type' => 'boolean')); 15 | } 16 | } -------------------------------------------------------------------------------- /tests/models/gnatUser.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 150); 9 | $this->hasColumn('foreign_id', 'integer', 10, array ('unique' => true,)); 10 | } 11 | 12 | public function setUp() 13 | { 14 | parent::setUp(); 15 | $this->hasOne('gnatEmail as Email', array('local'=> 'foreign_id', 'foreign'=>'id', 'onDelete'=>'CASCADE')); 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/models/mmrGroup_B.php: -------------------------------------------------------------------------------- 1 | hasMany('mmrUser_B', array('local' => 'group_id', 6 | 'foreign' => 'user_id', 7 | 'refClass' => 'mmrGroupUser_B')); 8 | } 9 | public function setTableDefinition() { 10 | // Works when 11 | $this->hasColumn('id', 'string', 30, array ( 'primary' => true)); 12 | $this->hasColumn('name', 'string', 30); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/mmrGroup_C.php: -------------------------------------------------------------------------------- 1 | hasMany('mmrUser_C', array('local' => 'group_id', 7 | 'foreign' => 'user_id', 8 | 'refClass' => 'mmrGroupUser_C')); 9 | } 10 | public function setTableDefinition() 11 | { 12 | $this->hasColumn('g_id as id', 'string', 30, array('primary' => true)); 13 | $this->hasColumn('name', 'string', 30); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/Book.php: -------------------------------------------------------------------------------- 1 | hasMany('Author', array('local' => 'id', 'foreign' => 'book_id')); 7 | $this->hasOne('User', array('local' => 'user_id', 8 | 'foreign' => 'id', 9 | 'onDelete' => 'CASCADE')); 10 | } 11 | public function setTableDefinition() 12 | { 13 | $this->hasColumn('user_id', 'integer'); 14 | $this->hasColumn('name', 'string',20); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/Policy.php: -------------------------------------------------------------------------------- 1 | hasColumn('policy_number', 'integer', 11, array('unique' => true)); 7 | } 8 | 9 | public function setUp() 10 | { 11 | $this->hasMany('PolicyAsset as PolicyAssets', array('local' => 'policy_number', 12 | 'foreign' => 'policy_number')); 13 | $this->index('policy_number_index', array('fields' => array('policy_number'))); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/Group.php: -------------------------------------------------------------------------------- 1 | Doctrine_Connection 6 | // won't initialize grouptable when Doctrine_Connection->getTable('Group') is called 7 | class GroupTable { } 8 | 9 | class Group extends Entity 10 | { 11 | public function setUp() 12 | { 13 | parent::setUp(); 14 | $this->hasMany('User', array( 15 | 'local' => 'group_id', 16 | 'foreign' => 'user_id', 17 | 'refClass' => 'Groupuser', 18 | )); 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /tests/models/PolicyN.php: -------------------------------------------------------------------------------- 1 | setTableName('policies'); 7 | $this->hasColumn('id', 'integer', 4, array('notnull' => true, 'primary' => true, 'autoincrement' => true)); 8 | $this->hasColumn('rate_id', 'integer', 4, array ( )); 9 | $this->hasColumn('policy_number', 'integer', 4, array ( 'unique' => true, )); 10 | } 11 | 12 | public function setUp() 13 | { 14 | $this->hasOne('RateN', array('local' => 'rate_id', 'foreign' => 'id' )); 15 | } 16 | } -------------------------------------------------------------------------------- /tests/Migration/Diff/schema/from.yml: -------------------------------------------------------------------------------- 1 | --- 2 | User: 3 | columns: 4 | username: string(255) 5 | password: string(255) 6 | homepage_id: integer 7 | profile_id: integer 8 | is_active: 9 | type: boolean 10 | default: true 11 | relations: 12 | Profile: 13 | foreignType: one 14 | Homepage: 15 | foreignType: one 16 | indexes: 17 | is_active: 18 | fields: [is_active] 19 | 20 | Homepage: 21 | columns: 22 | title: string(255) 23 | 24 | Profile: 25 | columns: 26 | name: string(255) 27 | email_address: string(255) -------------------------------------------------------------------------------- /tests/migration_classes/2_add_user.class.php: -------------------------------------------------------------------------------- 1 | table($direction, 'migration_user', array('id' => array('type' => 'integer', 'length' => 20, 'autoincrement' => true, 'primary' => true), 'username' => array('type' => 'string', 'length' => 255), 'password' => array('type' => 'string', 'length' => 255)), array('indexes' => array(), 'primary' => array(0 => 'id'))); 10 | } 11 | } -------------------------------------------------------------------------------- /tests/models/Album.php: -------------------------------------------------------------------------------- 1 | hasMany('Song', array('local' => 'id', 'foreign' => 'album_id')); 7 | $this->hasOne('User', array('local' => 'user_id', 8 | 'foreign' => 'id', 9 | 'onDelete' => 'CASCADE')); 10 | } 11 | public function setTableDefinition() 12 | { 13 | $this->hasColumn('user_id', 'integer'); 14 | $this->hasColumn('name', 'string',20); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/models/ColumnAliasTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('column1 as alias1', 'string', 200); 7 | $this->hasColumn('column2 as alias2', 'integer', 4); 8 | $this->hasColumn('another_column as anotherField', 'string', 50); 9 | $this->hasColumn('book_id as bookId', 'integer', 4); 10 | } 11 | public function setUp() 12 | { 13 | $this->hasOne('Book as book', array('local' => 'book_id', 'foreign' => 'id')); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/Forum_Board.php: -------------------------------------------------------------------------------- 1 | hasColumn('category_id', 'integer', 10); 5 | $this->hasColumn('name', 'string', 100); 6 | $this->hasColumn('description', 'string', 5000); 7 | } 8 | public function setUp() { 9 | $this->hasOne('Forum_Category as Category', array('local' => 'category_id', 'foreign' => 'id')); 10 | $this->hasMany('Forum_Thread as Threads', array('local' => 'id', 'foreign' => 'board_id')); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/models/CascadeDeleteRelatedTest2.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | $this->hasColumn('cscd_id', 'integer'); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('CascadeDeleteRelatedTest', array('local' => 'cscd_id', 12 | 'foreign' => 'id', 13 | 'onDelete' => 'SET NULL')); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/MyUserOneThing.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'integer'); 5 | $this->hasColumn('one_thing_id', 'integer'); 6 | } 7 | 8 | 9 | public function setUp() 10 | { 11 | $this->hasOne('MyUser', array( 12 | 'local' => 'user_id', 'foreign' => 'id' 13 | )); 14 | 15 | $this->hasOne('MyOneThing', array( 16 | 'local' => 'one_thing_id', 'foreign' => 'id' 17 | )); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/models/TreeLeaf.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | $this->hasColumn('parent_id', 'integer'); 8 | } 9 | 10 | public function setUp() 11 | { 12 | $this->hasOne('TreeLeaf as Parent', array( 13 | 'local' => 'parent_id', 'foreign' => 'id' 14 | )); 15 | 16 | $this->hasMany('TreeLeaf as Children', array( 17 | 'local' => 'id', 'foreign' => 'parent_id' 18 | )); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "doctrine/doctrine1", 3 | "type": "library", 4 | "description": "PHP5 Database ORM", 5 | "keywords": ["orm", "database"], 6 | "homepage": "http://www.doctrine-project.org", 7 | "license": "LGPL", 8 | "authors": [ 9 | {"name": "Konsta Vesterinen", "email": "kvesteri@cc.hut.fi"}, 10 | {"name": "Jonathan Wage", "email": "jonwage@gmail.com"} 11 | ], 12 | "require": { 13 | "php": ">=5.2.3", 14 | "ext-pdo": "*" 15 | }, 16 | "autoload": { 17 | "psr-0": { "Doctrine_": "lib/" } 18 | } 19 | } -------------------------------------------------------------------------------- /tests/CliTestCase/cli-with-custom-tasks.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | require_once(dirname(dirname(dirname(__FILE__))) . '/lib/Doctrine.php'); 9 | spl_autoload_register(array('Doctrine', 'autoload')); 10 | 11 | $cli = new Doctrine_Cli(); 12 | 13 | require_once(dirname(__FILE__) . '/TestTask02.php'); 14 | 15 | //Either...: 16 | $cli->registerTaskClass('Doctrine_Cli_TestCase_TestTask02'); 17 | //...Or: 18 | $cli->registerIncludedTaskClasses(); 19 | 20 | $cli->run($_SERVER['argv']); -------------------------------------------------------------------------------- /tests/migration_classes/4_drop_profile.class.php: -------------------------------------------------------------------------------- 1 | table($direction, 'migration_profile', array('id' => array('type' => 'integer', 'length' => 20, 'autoincrement' => true, 'primary' => true), 'name' => array('type' => 'string', 'length' => 255)), array('indexes' => array(), 'primary' => array(0 => 'id'))); 11 | } 12 | } -------------------------------------------------------------------------------- /tests/models/App_Category.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 32); 5 | $this->hasColumn('parent_id', 'integer'); 6 | } 7 | public function setUp() { 8 | $this->hasMany('App', array( 9 | 'local' => 'id', 10 | 'foreign' => 'app_category_id' 11 | )); 12 | 13 | $this->hasMany('App_Category as Parent', array( 14 | 'local' => 'parent_id', 15 | 'foreign' => 'id' 16 | )); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/Forum_Thread.php: -------------------------------------------------------------------------------- 1 | hasColumn('board_id', 'integer', 10); 5 | $this->hasColumn('updated', 'integer', 10); 6 | $this->hasColumn('closed', 'integer', 1); 7 | } 8 | public function setUp() { 9 | $this->hasOne('Forum_Board as Board', array('local' => 'board_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 10 | $this->hasMany('Forum_Entry as Entries', array('local' => 'id', 'foreign' => 'thread_id')); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/models/Element.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 100); 5 | $this->hasColumn('parent_id', 'integer'); 6 | } 7 | public function setUp() { 8 | $this->hasMany('Element as Child', array('local' => 'id', 9 | 'foreign' => 'parent_id')); 10 | $this->hasOne('Element as Parent', array('local' => 'parent_id', 11 | 'foreign' => 'id')); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/models/MyUserOtherThing.php: -------------------------------------------------------------------------------- 1 | hasColumn('user_id', 'integer'); 5 | $this->hasColumn('other_thing_id', 'integer'); 6 | } 7 | 8 | 9 | public function setUp() 10 | { 11 | $this->hasOne('MyUser', array( 12 | 'local' => 'user_id', 'foreign' => 'id' 13 | )); 14 | 15 | $this->hasOne('MyOtherThing', array( 16 | 'local' => 'other_thing_id', 'foreign' => 'id' 17 | )); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/models/PolicyAsset.php: -------------------------------------------------------------------------------- 1 | hasColumn('policy_number', 'integer', 11); 7 | $this->hasColumn('value', 'float', 10, array ('notblank' => true,)); 8 | } 9 | 10 | public function setUp() 11 | { 12 | $this->hasOne('Policy', array('foreign' => 'policy_number', 13 | 'local' => 'policy_number')); 14 | $this->index('policy_number_index', array('fields' => array('policy_number'))); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/EventListenerTest.php: -------------------------------------------------------------------------------- 1 | hasColumn("name", "string", 100); 5 | $this->hasColumn("password", "string", 8); 6 | } 7 | public function setUp() { 8 | //$this->attribute(Doctrine_Core::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker()); 9 | } 10 | public function getName($name) { 11 | return strtoupper($name); 12 | } 13 | public function setPassword($password) { 14 | return md5($password); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/models/InheritanceDeal.php: -------------------------------------------------------------------------------- 1 | setTableName('inheritance_deal'); 7 | 8 | $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); 9 | $this->hasColumn('name', 'string', 255, array ()); 10 | } 11 | 12 | public function setUp() 13 | { 14 | $this->hasMany('InheritanceUser as Users', array('refClass' => 'InheritanceDealUser', 'local' => 'entity_id', 'foreign' => 'user_id')); 15 | } 16 | } -------------------------------------------------------------------------------- /tests/models/mmrUser_B.php: -------------------------------------------------------------------------------- 1 | hasMany('mmrGroup_B as Group', array('local' => 'user_id', 7 | 'foreign' => 'group_id', 8 | 'refClass' => 'mmrGroupUser_B')); 9 | 10 | } 11 | 12 | public function setTableDefinition() 13 | { 14 | // Works when 15 | $this->hasColumn('id', 'string', 30, array ( 'primary' => true)); 16 | $this->hasColumn('name', 'string', 30); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/InheritanceUser.php: -------------------------------------------------------------------------------- 1 | setTableName('inheritance_user'); 7 | 8 | $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); 9 | $this->hasColumn('username', 'string', 128, array ( 'notnull' => true,)); 10 | } 11 | 12 | public function setUp() 13 | { 14 | $this->hasMany('InheritanceDeal as Deals', array('refClass' => 'InheritanceDealUser', 'local' => 'user_id', 'foreign' => 'entity_id')); 15 | } 16 | } -------------------------------------------------------------------------------- /tests/migration_classes/1_add_phonenumber.class.php: -------------------------------------------------------------------------------- 1 | table($direction, 'migration_phonenumber', array('id' => array('type' => 'integer', 'length' => 20, 'autoincrement' => true, 'primary' => true), 'user_id' => array('type' => 'integer', 'length' => 2147483647), 'phonenumber' => array('type' => 'string', 'length' => 2147483647)), array('indexes' => array(), 'primary' => array(0 => 'id'))); 10 | } 11 | } -------------------------------------------------------------------------------- /tests/models/App.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 32); 5 | $this->hasColumn('user_id', 'integer', 11); 6 | $this->hasColumn('app_category_id', 'integer', 11); 7 | } 8 | public function setUp() { 9 | $this->hasOne('User', array( 10 | 'local' => 'user_id', 'foreign' => 'id' 11 | )); 12 | 13 | $this->hasOne('App_Category as Category', array( 14 | 'local' => 'app_category_id', 15 | 'foreign' => 'id' 16 | )); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/models/EventListenerChainTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 100); 6 | } 7 | public function setUp() { 8 | $chain = new Doctrine_EventListener_Chain(); 9 | $chain->add(new Doctrine_EventListener_TestA()); 10 | $chain->add(new Doctrine_EventListener_TestB()); 11 | } 12 | } 13 | 14 | class Doctrine_EventListener_TestA extends Doctrine_EventListener 15 | { 16 | 17 | } 18 | class Doctrine_EventListener_TestB extends Doctrine_EventListener 19 | { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tests/models/FieldNameTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('someColumn', 'string', 200, array('default' => 'some string')); 7 | $this->hasColumn('someEnum', 'enum', 4, array('default' => 'php', 'values' => array('php', 'java', 'python'))); 8 | $this->hasColumn('someArray', 'array', 100, array('default' => array())); 9 | $this->hasColumn('someObject', 'object', 200, array('default' => new stdClass)); 10 | $this->hasColumn('someInt', 'integer', 20, array('default' => 11)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/models/mmrUser_C.php: -------------------------------------------------------------------------------- 1 | hasMany('mmrGroup_C as Group', array('local' => 'user_id', 7 | 'foreign' => 'group_id', 8 | 'refClass' => 'mmrGroupUser_C')); 9 | 10 | } 11 | 12 | public function setTableDefinition() 13 | { 14 | // Works when 15 | $this->hasColumn('u_id as id', 'string', 30, array('primary' => true)); 16 | $this->hasColumn('name', 'string', 30); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/models/MysqlIndexTestRecord.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null); 7 | $this->hasColumn('code', 'integer', 4); 8 | $this->hasColumn('content', 'string', 4000); 9 | 10 | $this->index('content', array('fields' => array('content'), 'type' => 'fulltext')); 11 | $this->index('namecode', array('fields' => array('name', 'code'), 12 | 'type' => 'unique')); 13 | 14 | $this->option('type', 'MYISAM'); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/models/Task.php: -------------------------------------------------------------------------------- 1 | hasMany('Resource as ResourceAlias', array('local' => 'task_id', 5 | 'foreign' => 'resource_id', 6 | 'refClass' => 'Assignment')); 7 | $this->hasMany('Task as Subtask', array('local' => 'id', 'foreign' => 'parent_id')); 8 | } 9 | public function setTableDefinition() { 10 | $this->hasColumn('name', 'string',100); 11 | $this->hasColumn('parent_id', 'integer'); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/models/Record_City.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | $this->hasColumn('country_id', 'integer'); 6 | $this->hasColumn('district_id', 'integer'); 7 | } 8 | 9 | public function setUp() { 10 | $this->hasOne('Record_Country as Country', array( 11 | 'local' => 'country_id', 'foreign' => 'id' 12 | )); 13 | 14 | $this->hasOne('Record_District as District', array( 15 | 'local' => 'district_id', 'foreign' => 'id' 16 | )); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/MyGroup.php: -------------------------------------------------------------------------------- 1 | setTableName('my_group'); 7 | 8 | $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); 9 | $this->hasColumn('name', 'string', 255, array ( 'notnull' => true,)); 10 | $this->hasColumn('description', 'string', 4000, array ()); 11 | } 12 | 13 | public function setUp() 14 | { 15 | $this->hasMany('MyUser as users', array('refClass' => 'MyUserGroup', 'local' => 'group_id', 'foreign' => 'user_id')); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/models/ORM_TestEntry.php: -------------------------------------------------------------------------------- 1 | setTableName('test_entries'); 5 | $this->hasColumn('id', 'integer', 11, 'autoincrement|primary'); 6 | $this->hasColumn('name', 'string', 255); 7 | $this->hasColumn('stamp', 'timestamp'); 8 | $this->hasColumn('amount', 'float'); 9 | $this->hasColumn('itemID', 'integer'); 10 | } 11 | 12 | public function setUp() { 13 | $this->hasOne('ORM_TestItem', array( 14 | 'local' => 'itemID', 'foreign' => 'id' 15 | )); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/Migration/Diff/schema/to.yml: -------------------------------------------------------------------------------- 1 | --- 2 | User: 3 | columns: 4 | username: 5 | type: string(255) 6 | unique: true 7 | notnull: true 8 | password: string(255) 9 | is_active: 10 | type: boolean 11 | default: true 12 | 13 | Profile: 14 | columns: 15 | user_id: integer 16 | name: string(255) 17 | email_address: string(255) 18 | relations: 19 | User: 20 | onDelete: CASCADE 21 | foreignType: one 22 | 23 | BlogPost: 24 | columns: 25 | user_id: integer 26 | title: string(255) 27 | body: clob 28 | relations: 29 | User: 30 | onDelete: CASCADE 31 | foreignAlias: BlogPosts -------------------------------------------------------------------------------- /tests/Search/_files/content.html: -------------------------------------------------------------------------------- 1 | Database transaction 2 | From Wikipedia, the free encyclopedia 3 | Jump to: navigation, search 4 | A database transaction is a unit of interaction with a database management system or similar system that is treated in a coherent and reliable way independent of other transactions that must be either entirely completed or aborted. Ideally, a database system will guarantee the properties of Atomicity, Consistency, Isolation and Durability (ACID) for each transaction. In practice, these properties are often relaxed somewhat to provide better performance. 5 | 6 | In some systems, transactions are also called LUWs for Logical Units of Work. 7 | 8 | -------------------------------------------------------------------------------- /tests/Ticket/1768TestCase.php: -------------------------------------------------------------------------------- 1 | from('Ticket_1768_Foo f') 8 | ->where('f.bar = ?', 1); 9 | 10 | $queryTwo = Doctrine_Query::create() 11 | ->from('Ticket_1768_Foo f') 12 | ->where('f.bar = ?', 2); 13 | 14 | //Result hashes should be different 15 | $this->assertNotEqual($queryOne->calculateResultCacheHash(), $queryTwo->calculateResultCacheHash()); 16 | } 17 | } -------------------------------------------------------------------------------- /tests/Record/LockTestCase.php: -------------------------------------------------------------------------------- 1 | tables[] = 'rec1'; 6 | $this->tables[] = 'rec2'; 7 | parent::prepareTables(); 8 | } 9 | 10 | public function prepareData() { } 11 | 12 | public function testDeleteRecords() 13 | { 14 | $rec1 = new Rec1(); 15 | $rec1->first_name = 'Some name'; 16 | $rec1->Account = new Rec2(); 17 | $rec1->Account->address = 'Some address'; 18 | $rec1->save(); 19 | 20 | $rec1->delete(); 21 | $this->pass(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/models/Resource.php: -------------------------------------------------------------------------------- 1 | hasMany('Task as TaskAlias', array('local' => 'resource_id', 5 | 'foreign' => 'task_id', 6 | 'refClass' => 'Assignment')); 7 | $this->hasMany('ResourceType as Type', array('local' => 'resource_id', 8 | 'foreign' => 'type_id', 9 | 'refClass' => 'ResourceReference')); 10 | } 11 | public function setTableDefinition() { 12 | $this->hasColumn('name', 'string',100); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/models/export/Cms_Category.php: -------------------------------------------------------------------------------- 1 | hasMany('Cms_CategoryLanguages as langs', array('local' => 'id', 'foreign' => 'category_id')); 8 | } 9 | 10 | public function setTableDefinition() 11 | { 12 | $this->hasColumn('created', 'timestamp'); 13 | $this->hasColumn('parent', 'integer', 11); 14 | $this->hasColumn('position', 'integer', 3); 15 | $this->hasColumn('active', 'integer', 11); 16 | $this->option('collate', 'utf8_unicode_ci'); 17 | $this->option('charset', 'utf8'); 18 | $this->option('type', 'INNODB'); 19 | $this->index('index_parent', array('fields' => array('parent'))); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 7 | $this->hasColumn('parent_id', 'integer'); 8 | } 9 | } 10 | 11 | class RelationTestChild extends RelationTest 12 | { 13 | public function setUp() 14 | { 15 | $this->hasOne('RelationTest as Parent', array( 16 | 'local' => 'parent_id', 17 | 'foreign' => 'id', 18 | 'onDelete' => 'CASCADE', 19 | )); 20 | $this->hasMany('RelationTestChild as Children', array( 21 | 'local' => 'id', 22 | 'foreign' => 'parent_id', 23 | )); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/models/MyUserGroup.php: -------------------------------------------------------------------------------- 1 | setTableName('my_user_group'); 7 | 8 | $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); 9 | $this->hasColumn('group_id', 'integer', 4, array ()); 10 | $this->hasColumn('user_id', 'integer', 4, array ()); 11 | } 12 | 13 | public function setUp() 14 | { 15 | $this->hasOne('MyGroup as MyGroup', array('local' => 'group_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 16 | $this->hasOne('MyUser as MyUser', array('local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/M2MTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', 200); 5 | $this->hasColumn('child_id', 'integer'); 6 | } 7 | public function setUp() { 8 | 9 | $this->hasMany('RTC1 as RTC1', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC1')); 10 | $this->hasMany('RTC2 as RTC2', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC1')); 11 | $this->hasMany('RTC3 as RTC3', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC2')); 12 | $this->hasMany('RTC3 as RTC4', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC1')); 13 | 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/models/TestUser.php: -------------------------------------------------------------------------------- 1 | hasMany('TestMovie as UserBookmarks', 7 | array('local' => 'user_id', 8 | 'foreign' => 'movie_id', 9 | 'refClass' => 'TestMovieUserBookmark')); 10 | 11 | $this->hasMany('TestMovie as UserVotes', 12 | array('local' => 'user_id', 13 | 'foreign' => 'movie_id', 14 | 'refClass' => 'TestMovieUserVote')); 15 | 16 | } 17 | public function setTableDefinition() 18 | { 19 | $this->hasColumn('name', 'string', 30); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/models/ValidatorTest_ClientModel.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', 4, array('notnull' => true, 6 | 'primary' => true, 7 | 'autoincrement' => true, 8 | 'unsigned' => true)); 9 | $this->hasColumn('short_name', 'string', 32, array('notnull' => true, 'notblank', 'unique' => true)); 10 | } 11 | 12 | public function setUp() { 13 | $this->hasMany("ValidatorTest_AddressModel", array('local' => 'client_id', 'foreign' => 'address_id', 'refClass' => 'ValidatorTest_ClientToAddressModel')); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/App_User.php: -------------------------------------------------------------------------------- 1 | hasColumn('first_name', 'string', 32); 5 | $this->hasColumn('last_name', 'string', 32); 6 | $this->hasColumn('email', 'string', 128, 'email'); 7 | $this->hasColumn('username', 'string', 16, 'unique, nospace'); 8 | $this->hasColumn('password', 'string', 128, 'notblank'); 9 | $this->hasColumn('country', 'string', 2, 'country'); 10 | $this->hasColumn('zipcode', 'string', 9, 'nospace'); 11 | } 12 | public function setUp() { 13 | $this->hasMany('App', array( 14 | 'local' => 'id', 15 | 'foreign' => 'user_id' 16 | )); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/Forum_Entry.php: -------------------------------------------------------------------------------- 1 | hasColumn('author', 'string', 50); 5 | $this->hasColumn('topic', 'string', 100); 6 | $this->hasColumn('message', 'string', 99999); 7 | $this->hasColumn('parent_entry_id', 'integer', 10); 8 | $this->hasColumn('thread_id', 'integer', 10); 9 | $this->hasColumn('date', 'integer', 10); 10 | } 11 | public function setUp() { 12 | $this->hasOne('Forum_Entry as Parent', array('local' => 'id', 'foreign' => 'parent_entry_id')); 13 | $this->hasOne('Forum_Thread as Thread', array('local' => 'thread_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tools/sandbox/doctrine.php: -------------------------------------------------------------------------------- 1 | DATA_FIXTURES_PATH, 8 | 'models_path' => MODELS_PATH, 9 | 'migrations_path' => MIGRATIONS_PATH, 10 | 'sql_path' => SQL_PATH, 11 | 'yaml_schema_path' => YAML_SCHEMA_PATH, 12 | 'generate_models_options' => array( 13 | 'pearStyle' => true, 14 | 'generateTableClasses' => true, 15 | 'baseClassPrefix' => 'Base', 16 | 'baseClassesDirectory' => null, 17 | ) 18 | ); 19 | 20 | $cli = new Doctrine_Cli($config); 21 | $cli->run($_SERVER['argv']); -------------------------------------------------------------------------------- /tests/models/Blog.php: -------------------------------------------------------------------------------- 1 | actAs('Taggable'); 11 | } 12 | } 13 | class Taggable extends Doctrine_Template 14 | { 15 | public function setUp() 16 | { 17 | //$this->hasMany('[Component]TagTemplate as Tag'); 18 | } 19 | } 20 | class TagTemplate extends Doctrine_Record 21 | { 22 | public function setTableDefinition() 23 | { 24 | $this->hasColumn('name', 'string', 100); 25 | $this->hasColumn('description', 'string'); 26 | } 27 | 28 | public function setUp() 29 | { 30 | //$this->hasOne('[Component]', array('onDelete' => 'CASCADE')); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/models/QueryTest_Entry.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', 4, array('primary', 'autoincrement', 'notnull')); 10 | $this->hasColumn('authorId', 'integer', 4, 11 | array('notnull')); 12 | $this->hasColumn('date', 'integer', 4, 13 | array('notnull')); 14 | } 15 | 16 | /** 17 | * Runtime definition of the relationships to other entities. 18 | */ 19 | public function setUp() 20 | { 21 | $this->hasOne('QueryTest_User as author', array( 22 | 'local' => 'authorId', 'foreign' => 'id' 23 | )); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/models/ValidatorTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('mymixed', 'string', 100); 5 | $this->hasColumn('mystring', 'string', 100, array('notnull', 'unique')); 6 | $this->hasColumn('myarray', 'array', 1000); 7 | $this->hasColumn('myobject', 'object', 1000); 8 | $this->hasColumn('myinteger', 'integer', 11); 9 | $this->hasColumn('myrange', 'integer', 11, array('range' => array(4,123))); 10 | $this->hasColumn('myregexp', 'string', 5, array('regexp' => '/^[0-9]+$/')); 11 | 12 | $this->hasColumn('myemail', 'string', 100, array('email')); 13 | $this->hasColumn('myemail2', 'string', 100, array('email', 'notblank')); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/models/CascadeDeleteRelatedTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | $this->hasColumn('cscd_id', 'integer'); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('CascadeDeleteTest', array('local' => 'cscd_id', 12 | 'foreign' => 'id', 13 | 'onDelete' => 'CASCADE', 14 | 'onUpdate' => 'SET NULL')); 15 | 16 | $this->hasMany('CascadeDeleteRelatedTest2 as Related', 17 | array('local' => 'id', 18 | 'foreign' => 'cscd_id')); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Ticket/1617_schema.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Column Aggregation Inheritance 3 | # Single table, all children columns are stored in the parent, parent class has a type method 4 | # Which is used to determine which child the record in the db belonds to 5 | term: 6 | columns: 7 | name: string(255) 8 | type: string(255) 9 | language: 10 | name: lang as language 11 | type: string(2) 12 | 13 | alternativeTerm: 14 | inheritance: 15 | type: column_aggregation 16 | keyField: type 17 | keyValue: 'alt' 18 | extends: term 19 | 20 | preferdTerm: 21 | inheritance: 22 | type: column_aggregation 23 | keyField: type 24 | keyValue: 'pref' 25 | extends: term 26 | 27 | currentLanguagePreferedTerm: 28 | inheritance: 29 | type: column_aggregation 30 | keyField: language 31 | keyValue: 'de' 32 | extends: preferdTerm -------------------------------------------------------------------------------- /tests/models/export/Cms_CategoryLanguages.php: -------------------------------------------------------------------------------- 1 | setAttribute(Doctrine_Core::ATTR_COLL_KEY, 'language_id'); 7 | $this->hasOne('Cms_Category as category', array('local' => 'category_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 8 | } 9 | 10 | public function setTableDefinition() 11 | { 12 | $this->hasColumn('name', 'string',256); 13 | $this->hasColumn('category_id', 'integer',11); 14 | $this->hasColumn('language_id', 'integer',11); 15 | $this->option('collate', 'utf8_unicode_ci'); 16 | $this->option('charset', 'utf8'); 17 | $this->option('type', 'INNODB'); 18 | $this->index('index_category', array('fields' => array('category_id'))); 19 | $this->index('index_language', array('fields' => array('language_id'))); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/models/QueryTest_Rank.php: -------------------------------------------------------------------------------- 1 | hasColumn('title as title', 'string', 100, 10 | array('notnull')); 11 | $this->hasColumn('color as color', 'string', 20, 12 | array('notnull', 'regexp' => '/^[a-zA-Z\-]{3,}|#[0-9a-fA-F]{6}$/D')); 13 | $this->hasColumn('icon as icon', 'string', 50, 14 | array('notnull', 'default' => ' ', 'regexp' => '/^[a-zA-Z0-9_\-]+\.(jpg|gif|png)$/D')); 15 | } 16 | 17 | public function setUp() 18 | { 19 | $this->hasMany('QueryTest_User as users', array( 20 | 'local' => 'rankId', 'foreign' => 'userId', 'refClass' => 'QueryTest_UserRank' 21 | )); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/models/ForeignKeyTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null); 7 | $this->hasColumn('code', 'integer', 4); 8 | $this->hasColumn('content', 'string', 4000); 9 | $this->hasColumn('parent_id', 'integer'); 10 | 11 | $this->hasOne('ForeignKeyTest as Parent', 12 | array('local' => 'parent_id', 13 | 'foreign' => 'id', 14 | 'onDelete' => 'CASCADE', 15 | 'onUpdate' => 'RESTRICT') 16 | ); 17 | 18 | $this->hasMany('ForeignKeyTest as Children', array( 19 | 'local' => 'id', 'foreign' => 'parent_id', 'cascade' => array('delete'))); 20 | 21 | $this->option('type', 'INNODB'); 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/Ticket/1783TestCase.php: -------------------------------------------------------------------------------- 1 | tables[] = 'Ticket_1783'; 7 | parent::prepareTables(); 8 | } 9 | 10 | public function testValidateLargeIntegers() 11 | { 12 | $this->manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL); 13 | 14 | $test = new Ticket_1783(); 15 | $test->bigint = PHP_INT_MAX + 1; 16 | 17 | $this->assertTrue($test->isValid()); 18 | 19 | $this->manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_NONE); 20 | } 21 | } 22 | 23 | class Ticket_1783 extends Doctrine_Record 24 | { 25 | public function setTableDefinition() 26 | { 27 | $this->hasColumn('bigint', 'integer', null, array('type' => 'integer', 'unsigned' => true)); 28 | } 29 | } -------------------------------------------------------------------------------- /tests/models/Phonenumber.php: -------------------------------------------------------------------------------- 1 | hasColumn('phonenumber', 'string',20); 7 | $this->hasColumn('entity_id', 'integer'); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('Entity', array('local' => 'entity_id', 12 | 'foreign' => 'id', 13 | 'onDelete' => 'CASCADE')); 14 | 15 | $this->hasOne('Group', array('local' => 'entity_id', 16 | 'foreign' => 'id', 17 | 'onDelete' => 'CASCADE')); 18 | 19 | $this->hasOne('User', array('local' => 'entity_id', 20 | 'foreign' => 'id', 21 | 'onDelete' => 'CASCADE')); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/models/Forum_Category.php: -------------------------------------------------------------------------------- 1 | hasColumn('root_category_id', 'integer', 10); 5 | $this->hasColumn('parent_category_id', 'integer', 10); 6 | $this->hasColumn('name', 'string', 50); 7 | $this->hasColumn('description', 'string', 99999); 8 | } 9 | public function setUp() { 10 | $this->hasMany('Forum_Category as Subcategory', array( 11 | 'local' => 'id', 12 | 'foreign' => 'parent_category_id' 13 | )); 14 | 15 | $this->hasOne('Forum_Category as Parent', array( 16 | 'local' => 'parent_category_id', 17 | 'foreign' => 'id' 18 | )); 19 | 20 | $this->hasOne('Forum_Category as Rootcategory', array( 21 | 'local' => 'root_category_id', 22 | 'foreign' => 'id' 23 | )); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/models/I18nRelationTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('title', 'string', 200); 7 | $this->hasColumn('author_id', 'integer', 4); 8 | } 9 | public function setUp() 10 | { 11 | $this->hasOne('I18nAuthorTest', array('local' => 'author_id', 12 | 'foreign' => 'id')); 13 | $this->actAs('I18n', array('fields' => array('author_id', 'title'))); 14 | } 15 | } 16 | 17 | class I18nAuthorTest extends Doctrine_Record 18 | { 19 | public function setTableDefinition() 20 | { 21 | $this->hasColumn('id', 'integer', 4, array('primary' => true, 'autoincrement' => true)); 22 | } 23 | public function setUp() 24 | { 25 | $this->hasMany('I18nRelationTest', array('local' => 'id', 26 | 'foreign' => 'author_id')); 27 | } 28 | } -------------------------------------------------------------------------------- /tests/models/ValidatorTest_AddressModel.php: -------------------------------------------------------------------------------- 1 | hasColumn("id", "integer", 11, array('autoincrement' => true, 6 | 'primary' => true 7 | )); 8 | $this->hasColumn('address1', 'string', 255, array('notnull' => true, 'notblank')); 9 | $this->hasColumn('address2', 'string', 255, array('notnull' => true)); 10 | $this->hasColumn('city', 'string', 255, array('notnull' => true, 'notblank')); 11 | $this->hasColumn('state', 'string', 10, array('notnull' => true, 'notblank', 'usstate')); 12 | $this->hasColumn('zip', 'string', 15, array('notnull' => true, 'notblank', 'regexp' => '/^[0-9-]*$/')); 13 | } 14 | 15 | public function setUp() { 16 | $this->hasMany('ValidatorTest_ClientModel', array('local' => 'address_id', 'foreign' => 'client_id', 'refClass' => 'ValidatorTest_ClientToAddressModel')); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/models/TestMovie.php: -------------------------------------------------------------------------------- 1 | hasOne('TestUser as User', 8 | array('local' => 'user_id', 9 | 'foreign' => 'id')); 10 | 11 | $this->hasMany('TestUser as MovieBookmarks', 12 | array('local' => 'movie_id', 13 | 'foreign' => 'user_id', 14 | 'refClass' => 'TestMovieUserBookmark')); 15 | 16 | $this->hasMany('TestUser as MovieVotes', 17 | array('local' => 'movie_id', 18 | 'foreign' => 'user_id', 19 | 'refClass' => 'TestMovieUserVote')); 20 | } 21 | 22 | public function setTableDefinition() 23 | { 24 | $this->hasColumn('user_id', 'integer', null); 25 | $this->hasColumn('name', 'string', 30); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/models/ZeroValueTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', 4, array('primary' => true, 'autoincrement' => true,)); 7 | $this->hasColumn('username', 'string', 128, array('notnull' => true,)); 8 | $this->hasColumn('algorithm', 'string', 128, array('default' => 'sha1', 'notnull' => true,)); 9 | $this->hasColumn('salt', 'string', 128, array('notnull' => true,)); 10 | $this->hasColumn('password', 'string', 128, array('notnull' => true,)); 11 | $this->hasColumn('created_at', 'timestamp', null, array()); 12 | $this->hasColumn('last_login', 'timestamp', null, array()); 13 | $this->hasColumn('is_active', 'boolean', null, array('default' => true, 'notnull' => true,)); 14 | $this->hasColumn('is_super_admin', 'boolean', null, array('default' => false, 'notnull' => true,)); 15 | } 16 | 17 | public function setUp() 18 | { } 19 | } 20 | -------------------------------------------------------------------------------- /tests/UnsortedTestCase.php: -------------------------------------------------------------------------------- 1 | description = 'Package'; 13 | 14 | $packageverison = new PackageVersion(); 15 | $packageverison->description = 'Version'; 16 | 17 | $packageverisonnotes = new PackageVersionNotes(); 18 | $packageverisonnotes->description = 'Notes'; 19 | 20 | $package->Version[0] = $packageverison; 21 | $package->Version[0]->Note[0] = $packageverisonnotes; 22 | 23 | $package->save(); 24 | 25 | $this->assertNotNull($package->id); 26 | $this->assertNotNull($package->Version[0]->id); 27 | $this->assertNotNull($package->Version[0]->Note[0]->id); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/models/QueryTest_User.php: -------------------------------------------------------------------------------- 1 | hasColumn('username as username', 'string', 50, 8 | array('notnull')); 9 | $this->hasColumn('visibleRankId', 'integer', 4); 10 | $this->hasColumn('subscriptionId', 'integer', 4); 11 | } 12 | 13 | /** 14 | * Runtime definition of the relationships to other entities. 15 | */ 16 | public function setUp() 17 | { 18 | $this->hasOne('QueryTest_Rank as visibleRank', array( 19 | 'local' => 'visibleRankId', 'foreign' => 'id' 20 | )); 21 | 22 | $this->hasOne('QueryTest_Subscription', array( 23 | 'local' => 'subscriptionId', 'foreign' => 'id' 24 | )); 25 | 26 | $this->hasMany('QueryTest_Rank as ranks', array( 27 | 'local' => 'userId', 'foreign' => 'rankId', 'refClass' => 'QueryTest_UserRank' 28 | )); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/models/RateN.php: -------------------------------------------------------------------------------- 1 | setTableName('rates'); 7 | $this->hasColumn('id', 'integer', 4, array('notnull' => true, 'primary' => true, 'autoincrement' => true)); 8 | $this->hasColumn('policy_code', 'integer', 4, array ( 'notnull' => true, 'notblank' => true,)); 9 | $this->hasColumn('coverage_code', 'integer', 4, array ( 'notnull' => true, 'notblank' => true,)); 10 | $this->hasColumn('liability_code', 'integer', 4, array ( 'notnull' => true, 'notblank' => true,)); 11 | $this->hasColumn('total_rate', 'float', null, array ( 'notnull' => true, 'notblank' => true,)); 12 | } 13 | 14 | public function setUp() 15 | { 16 | $this->hasOne('PolicyCodeN', array('local' => 'policy_code', 'foreign' => 'code' )); 17 | $this->hasOne('CoverageCodeN', array('local' => 'coverage_code', 'foreign' => 'code' )); 18 | $this->hasOne('LiabilityCodeN', array('local' => 'liability_code', 'foreign' => 'code' )); 19 | } 20 | } -------------------------------------------------------------------------------- /tests/unsolved.php: -------------------------------------------------------------------------------- 1 | "; 12 | 13 | $manager = Doctrine_Manager::getInstance(); 14 | $dbh = Doctrine_Db::getConnection('sqlite::memory:'); 15 | $conn = $manager->openConnection($dbh); 16 | /** 17 | $user = new User(); 18 | $user->name = 'zYne'; 19 | $user->Phonenumber[0]->phonenumber = '123 123'; 20 | if ($user === $user->Phonenumber[0]->entity_id) { 21 | print 'case 1 works\n'; 22 | } 23 | $city = new Record_City(); 24 | $city->name = 'City 1'; 25 | $city->District->name = 'District 1'; 26 | 27 | if ($city->District === $city->district_id) { 28 | print 'case 2 works\n'; 29 | } 30 | */ 31 | 32 | $c = new Record_Country(); 33 | $c->name = 'Some country'; 34 | $city = $c->City[0]; 35 | $city->name = 'City 1'; 36 | $city->District->name = 'District 1'; 37 | 38 | $c->save(); 39 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyrights 2 | ---------- 3 | 4 | Doctrine 5 | -------- 6 | 7 | Doctrine is a Object Relational Mapper built from scratch with PHP5. It contains a few ports of other popular PHP classes/libraries. 8 | 9 | Url: http://www.doctrine-project.org 10 | Copyright: 2005-2007 Konsta Vesterinen 11 | License: LGPL - see LICENSE file 12 | 13 | symfony 14 | ------- 15 | 16 | Doctrine contains ports of a few symfony classes/libraries 17 | 18 | Url: http://www.symfony-project.com/ 19 | Copyright: Fabien Potencier 20 | License: MIT - see LICENSE file 21 | 22 | Spyc 23 | ---- 24 | 25 | Doctrine contains a port of the Spyc software 26 | 27 | Url: http://spyc.sourceforge.net/ 28 | Copyright: 2005-2006 Chris Wanstrath 29 | License: MIT - http://www.opensource.org/licenses/mit-license.php 30 | 31 | Zend Framework 32 | -------------- 33 | 34 | Doctrine contains ports of a few Zend components and has borrowed concepts and ideas from the Zend Framework project. 35 | 36 | Url: http://framework.zend.com 37 | Copyright: Copyright © 2006-2007 by Zend Technologies, All rights reserved. -------------------------------------------------------------------------------- /tests/DoctrineTest/Reporter/Cli.php: -------------------------------------------------------------------------------- 1 | format($name, 'INFO') . "\n"; 8 | echo str_repeat('=', strlen($name)) . "\n"; 9 | } 10 | 11 | public function paintFooter() 12 | { 13 | echo "\n"; 14 | echo $this->format("Tested: " . $this->_test->getTestCaseCount() . ' test cases.', 'INFO') . "\n"; 15 | echo $this->format("Successes: " . $this->_test->getPassCount() . " passes.", 'INFO') . "\n"; 16 | echo $this->format("Failures: " . $this->_test->getFailCount() . " fails.", $this->_test->getFailCount() ? 'ERROR':'INFO') . "\n"; 17 | echo $this->format("Number of new Failures: " . $this->_test->getNumNewFails(), $this->_test->getNumNewFails() ? 'ERROR':'INFO') . ' ' . implode(", ", $this->_test->getNewFails()) . "\n"; 18 | echo $this->format("Number of fixed Failures: " . $this->_test->getNumFixedFails(), $this->_test->getNumFixedFails() ? 'INFO':'HEADER') . ' ' . implode(", ", $this->_test->getFixedFails()) . "\n"; 19 | } 20 | } -------------------------------------------------------------------------------- /tests/models/NestTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | } 8 | public function setUp() 9 | { 10 | $this->hasMany('NestTest as Parents', array('local' => 'child_id', 11 | 'refClass' => 'NestReference', 12 | 'foreign' => 'parent_id')); 13 | $this->hasMany('NestTest as Children', array('local' => 'parent_id', 14 | 'refClass' => 'NestReference', 15 | 'foreign' => 'child_id')); 16 | 17 | $this->hasMany('NestTest as Relatives', array('local' => 'child_id', 18 | 'refClass' => 'NestReference', 19 | 'foreign' => 'parent_id', 20 | 'equal' => true)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/tmp/generated/BaseTicket_1527_User.php: -------------------------------------------------------------------------------- 1 | 14 | * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ 15 | */ 16 | abstract class BaseTicket_1527_User extends Doctrine_Record 17 | { 18 | public function setTableDefinition() 19 | { 20 | $this->setTableName('ticket_1527__user'); 21 | $this->hasColumn('username', 'string', 255, array( 22 | 'type' => 'string', 23 | 'extra' => 24 | array( 25 | 'test' => 123, 26 | ), 27 | 'length' => '255', 28 | )); 29 | $this->hasColumn('password', 'string', 255, array( 30 | 'type' => 'string', 31 | 'length' => '255', 32 | )); 33 | } 34 | 35 | public function setUp() 36 | { 37 | parent::setUp(); 38 | 39 | } 40 | } -------------------------------------------------------------------------------- /tests/models/VersioningTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string'); 7 | $this->hasColumn('version', 'integer'); 8 | } 9 | public function setUp() 10 | { 11 | $this->actAs('Versionable'); 12 | } 13 | } 14 | 15 | class VersioningTest2 extends Doctrine_Record 16 | { 17 | public function setTableDefinition() 18 | { 19 | $this->hasColumn('name', 'string'); 20 | $this->hasColumn('version', 'integer'); 21 | } 22 | public function setUp() 23 | { 24 | $this->actAs('Versionable', array('auditLog' => false)); 25 | } 26 | } 27 | 28 | class VersioningTest3 extends Doctrine_Record 29 | { 30 | public function setTableDefinition() 31 | { 32 | $this->hasColumn('name', 'string'); 33 | $this->hasColumn('version', 'integer'); 34 | } 35 | public function setUp() 36 | { 37 | 38 | $this->actAs('Versionable', array('tableName' => 'tbl_prefix_comments_version', 39 | 'className' => 'VersioningTestClass')); 40 | 41 | } 42 | } -------------------------------------------------------------------------------- /tests/models/QueryTest_Board.php: -------------------------------------------------------------------------------- 1 | hasColumn('id', 'integer', 4, array('primary', 'autoincrement', 'notnull')); 10 | $this->hasColumn('categoryId as categoryId', 'integer', 4, 11 | array('notnull')); 12 | $this->hasColumn('name as name', 'string', 100, 13 | array('notnull', 'unique')); 14 | $this->hasColumn('lastEntryId as lastEntryId', 'integer', 4, 15 | array('default' => 0)); 16 | $this->hasColumn('position as position', 'integer', 4, 17 | array('default' => 0, 'notnull')); 18 | } 19 | 20 | /** 21 | * Initializes the relations. 22 | */ 23 | public function setUp() 24 | { 25 | $this->hasOne('QueryTest_Category as category', array( 26 | 'local' => 'categoryId', 'foreign' => 'id' 27 | )); 28 | $this->hasOne('QueryTest_Entry as lastEntry', array( 29 | 'local' => 'lastEntryId', 'foreign' => 'id', 'onDelete' => 'CASCADE' 30 | )); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/models/MyUser2.php: -------------------------------------------------------------------------------- 1 | setTableName('my_user'); 7 | 8 | $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); 9 | $this->hasColumn('username', 'string', 128, array ( 'notnull' => true,)); 10 | $this->hasColumn('algorithm', 'string', 128, array ( 'default' => 'sha1', 'notnull' => true,)); 11 | $this->hasColumn('salt', 'string', 128, array ( 'notnull' => true,)); 12 | $this->hasColumn('password', 'string', 128, array ( 'notnull' => true,)); 13 | $this->hasColumn('created_at', 'timestamp', null, array ()); 14 | $this->hasColumn('last_login', 'timestamp', null, array ()); 15 | $this->hasColumn('is_active', 'boolean', null, array ( 'default' => 1, 'notnull' => true,)); 16 | $this->hasColumn('is_super_admin', 'boolean', null, array ( 'default' => 0, 'notnull' => true,)); 17 | } 18 | 19 | public function setUp() 20 | { 21 | $this->hasMany('MyGroup as groups', array('refClass' => 'MyUserGroup', 'local' => 'user_id', 'foreign' => 'group_id')); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/models/Entity.php: -------------------------------------------------------------------------------- 1 | hasOne('Email', array('local' => 'email_id', 'onDelete' => 'CASCADE')); 7 | $this->hasMany('Phonenumber', array('local' => 'id', 'foreign' => 'entity_id')); 8 | $this->hasOne('Account', array('foreign' => 'entity_id', 'onDelete' => 'CASCADE')); 9 | $this->hasMany('Entity', array('local' => 'entity1', 10 | 'refClass' => 'EntityReference', 11 | 'foreign' => 'entity2', 12 | 'equal' => true)); 13 | } 14 | public function setTableDefinition() 15 | { 16 | $this->hasColumn('id', 'integer',20, array('autoincrement', 'primary')); 17 | $this->hasColumn('name', 'string',50); 18 | $this->hasColumn('loginname', 'string',20, array('unique')); 19 | $this->hasColumn('password', 'string',16); 20 | $this->hasColumn('type', 'integer',1); 21 | $this->hasColumn('created', 'integer',11); 22 | $this->hasColumn('updated', 'integer',11); 23 | $this->hasColumn('email_id', 'integer'); 24 | $this->setSubclasses(array("User" => array("type" => 0), "Group" => array("type" => 1))); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/Ticket/583TestCase.php: -------------------------------------------------------------------------------- 1 | 8 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 9 | * @category Object Relational Mapping 10 | * @link www.doctrine-project.org 11 | * @since 1.0 12 | * @version $Revision$ 13 | */ 14 | 15 | class Doctrine_Ticket_583_TestCase extends Doctrine_UnitTestCase 16 | { 17 | public function prepareTables() 18 | { 19 | $this->tables = array('Entity'); 20 | parent::prepareTables(); 21 | } 22 | 23 | public function prepareData() { } 24 | 25 | public function testBug() 26 | { 27 | $entity = new Entity(); 28 | $entity->name = 'myname'; 29 | $entity->save(); 30 | 31 | // load our user and our collection of pages 32 | $user = Doctrine_Query::create()->select('id')->from('Entity')->fetchOne(); 33 | $this->assertEqual($user->name, 'myname'); 34 | 35 | // load our user and our collection of pages 36 | $user = Doctrine_Query::create()->select('*')->from('Entity')->fetchOne(); 37 | $this->assertEqual($user->name, 'myname'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/models/RecordHookTest.php: -------------------------------------------------------------------------------- 1 | hasColumn('name', 'string', null, array('primary' => true)); 9 | } 10 | public function preSave($event) 11 | { 12 | $this->_messages[] = __FUNCTION__; 13 | } 14 | public function postSave($event) 15 | { 16 | $this->_messages[] = __FUNCTION__; 17 | } 18 | public function preInsert($event) 19 | { 20 | $this->_messages[] = __FUNCTION__; 21 | } 22 | public function postInsert($event) 23 | { 24 | $this->_messages[] = __FUNCTION__; 25 | } 26 | public function preUpdate($event) 27 | { 28 | $this->_messages[] = __FUNCTION__; 29 | } 30 | public function postUpdate($event) 31 | { 32 | $this->_messages[] = __FUNCTION__; 33 | } 34 | public function preDelete($event) 35 | { 36 | $this->_messages[] = __FUNCTION__; 37 | } 38 | public function postDelete($event) 39 | { 40 | $this->_messages[] = __FUNCTION__; 41 | } 42 | public function pop() 43 | { 44 | return array_pop($this->_messages); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/Ticket/932TestCase.php: -------------------------------------------------------------------------------- 1 | tables[] = "UserNoAutoIncrement"; 8 | parent::prepareTables(); 9 | } 10 | 11 | public function prepareData() 12 | { 13 | } 14 | 15 | public function testInit() 16 | { 17 | $this->dbh = new Doctrine_Adapter_Mock('pgsql'); 18 | $this->conn = Doctrine_Manager::getInstance()->openConnection($this->dbh); 19 | $this->assertEqual(Doctrine_Core::IDENTIFIER_NATURAL, $this->conn->getTable('UserNoAutoIncrement')->getIdentifierType()); 20 | } 21 | 22 | public function testCreateNewUserNoAutoIncrement() 23 | { 24 | $newUser = new UserNoAutoIncrement(); 25 | $newUser->id = 1; 26 | $newUser->display_name = "Mah Name"; 27 | $newUser->save(); 28 | $this->assertEqual(Doctrine_Record::STATE_CLEAN, $newUser->state()); 29 | $this->assertEqual(1, $newUser->id); 30 | } 31 | } 32 | 33 | class UserNoAutoIncrement extends Doctrine_Record 34 | { 35 | public function setTableDefinition() 36 | { 37 | $this->hasColumn('id', 'integer', 4, array('primary' => true, 'autoincrement' => false, 'notnull' => true)); 38 | $this->hasColumn('display_name', 'string', 255, array('notnull' => true)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/models/SerializeTest.php: -------------------------------------------------------------------------------- 1 | setTableName('serialize_test'); 7 | 8 | $this->hasColumn('booltest', 'boolean'); 9 | $this->hasColumn('integertest', 'integer', 4, array('unsigned' => true)); 10 | $this->hasColumn('floattest', 'float'); 11 | $this->hasColumn('stringtest', 'string', 200, array('fixed' => true)); 12 | $this->hasColumn('arraytest', 'array', 10000); 13 | $this->hasColumn('objecttest', 'object'); 14 | $this->hasColumn('blobtest', 'blob'); 15 | $this->hasColumn('clobtest', 'clob'); 16 | $this->hasColumn('timestamptest', 'timestamp'); 17 | $this->hasColumn('timetest', 'time'); 18 | $this->hasColumn('datetest', 'date'); 19 | $this->hasColumn('enumtest', 'enum', 4, 20 | array( 21 | 'values' => array( 22 | 'php', 23 | 'java', 24 | 'python' 25 | ) 26 | ) 27 | ); 28 | $this->hasColumn('gziptest', 'gzip'); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/Search/_files/content.txt: -------------------------------------------------------------------------------- 1 | This file contains only contains some plain text copied from wikipedia. 2 | 3 | In database products the ability to handle transactions allows the user to ensure that integrity of a database is maintained. 4 | 5 | A single transaction might require several queries, each reading and/or writing information in the database. When this happens it is usually important to be sure that the database is not left with only some of the queries carried out. For example, when doing a money transfer, if the money was debited from one account, it is important that it also be credited to the depositing account. Also, transactions should not interfere with each other. For more information about desirable transaction properties, see ACID. 6 | 7 | A simple transaction is usually issued to the database system in a language like SQL in this form: 8 | 9 | Begin the transaction 10 | Execute several queries (although any updates to the database aren't actually visible to the outside world yet) 11 | Commit the transaction (updates become visible if the transaction is successful) 12 | If one of the queries fails the database system may rollback either the entire transaction or just the failed query. This behaviour is dependent on the DBMS in use and how it is set up. The transaction can also be rolled back manually at any time before the commit. 13 | -------------------------------------------------------------------------------- /tests/models/InheritanceDealUser.php: -------------------------------------------------------------------------------- 1 | setTableName('inheritance_entity_user'); 7 | 8 | $this->hasColumn('type', 'integer', 4, array ( 'primary' => true,)); 9 | $this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,)); 10 | $this->hasColumn('entity_id', 'integer', 4, array ( 'primary' => true,)); 11 | } 12 | 13 | public function setUp() 14 | { 15 | } 16 | } 17 | 18 | class InheritanceDealUser extends InheritanceEntityUser 19 | { 20 | public function setTableDefinition() 21 | { 22 | parent::setTableDefinition(); 23 | 24 | $this->setTableName('inheritance_entity_user'); 25 | 26 | $this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,)); 27 | $this->hasColumn('entity_id', 'integer', 4, array ( 'primary' => true,)); 28 | } 29 | 30 | public function setUp() 31 | { 32 | parent::setUp(); 33 | 34 | $this->hasOne('InheritanceUser as User', array('local' => 'user_id', 'foreign' => 'id')); 35 | $this->hasOne('InheritanceDeal as Deal', array('local' => 'entity_id', 'foreign' => 'id')); 36 | $this->setInheritanceMap(array ( 37 | 'type' => 1, 38 | )); 39 | } 40 | } -------------------------------------------------------------------------------- /tests/Query/ShortAliasesTestCase.php: -------------------------------------------------------------------------------- 1 | select('u.name')->from('User u'); 8 | 9 | $this->assertEqual($q->getSqlQuery(), 'SELECT e.id AS e__id, e.name AS e__name FROM entity e WHERE (e.type = 0)'); 10 | } 11 | */ 12 | public function testShortAliasesWithOneToManyLeftJoin() { 13 | $q = new Doctrine_Query(); 14 | 15 | $q->select('u.name, p.id')->from('User u LEFT JOIN u.Phonenumber p'); 16 | 17 | $this->assertEqual($q->getSqlQuery(), 'SELECT e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0)'); 18 | 19 | $users = $q->execute(); 20 | 21 | $this->assertEqual($users->count(), 8); 22 | 23 | } 24 | 25 | public function testQuoteEncapedDots() 26 | { 27 | $q = new Doctrine_Query(); 28 | $q->select("CONCAT('testing.dot\'\"s.inquotes', p.id, '\'\"') as test, u.name")->from('User u LEFT JOIN u.Phonenumber p'); 29 | $this->assertEqual($q->getSqlQuery(), "SELECT e.id AS e__id, e.name AS e__name, CONCAT('testing.dot\'\"s.inquotes', p.id, '\'\"') AS e__0 FROM entity e LEFT JOIN phonenumber p ON e.id = p.entity_id WHERE (e.type = 0)"); 30 | } 31 | } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Parser.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Parser 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | */ 32 | class Doctrine_Query_Parser 33 | { 34 | 35 | } -------------------------------------------------------------------------------- /tests/Ticket/697TestCase.php: -------------------------------------------------------------------------------- 1 | tables = array('T697_Person', 'T697_User'); 21 | parent::prepareTables(); 22 | } 23 | 24 | public function testIdsAreSetWhenSavingSubclassInstancesInCTI() 25 | { 26 | $p = new T697_Person(); 27 | $p['name']='Rodrigo'; 28 | $p->save(); 29 | $this->assertEqual(1, $p->id); 30 | 31 | $u = new T697_User(); 32 | $u['name']='Fernandes'; 33 | $u['password']='Doctrine RULES'; 34 | $u->save(); 35 | $this->assertEqual(2, $u->id); 36 | } 37 | } 38 | 39 | class T697_Person extends Doctrine_Record 40 | { 41 | public function setTableDefinition() 42 | { 43 | $this->hasColumn('name', 'string', 30); 44 | } 45 | } 46 | 47 | //Class table inheritance 48 | class T697_User extends T697_Person { 49 | public function setTableDefinition() 50 | { 51 | $this->hasColumn('password', 'string', 30); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /tests/template.tpl: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * %s 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class %s extends Doctrine_UnitTestCase 34 | { 35 | } -------------------------------------------------------------------------------- /lib/Doctrine/Util.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Util 24 | * 25 | * @package Doctrine 26 | * @subpackage Util 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Util extends Doctrine_Connection_Module 34 | { } -------------------------------------------------------------------------------- /tests/Ticket/1713TestCase.php: -------------------------------------------------------------------------------- 1 | tables = array('Parent1713', 'Child1713A'); 11 | parent::prepareTables(); 12 | } 13 | 14 | public function prepareData() 15 | { 16 | $record = new Child1713A(); 17 | $record['title'] = 'Child1713A'; 18 | $record->save(); 19 | } 20 | 21 | public function testInheritanceSubclasses() 22 | { 23 | $records = Doctrine_Query::create()->query('FROM Parent1713 m'); 24 | 25 | foreach ($records as $rec) { 26 | $this->assertEqual(get_class($rec), $rec['title']); 27 | } 28 | } 29 | } 30 | 31 | class Parent1713 extends Doctrine_Record 32 | { 33 | public function setTableDefinition() 34 | { 35 | $this->setTableName('mytable'); 36 | $this->hasColumn('id', 'integer', 4, array ( 37 | 'primary' => true, 38 | 'autoincrement' => true, 39 | 'notnull' => true, 40 | )); 41 | 42 | $this->hasColumn('title', 'string', 255, array ()); 43 | $this->hasColumn('PHP_TYPE as phpType', 'integer', 11, array ()); 44 | 45 | $this->setSubclasses( 46 | array('Child1713A' => array('phpType' => 1)) 47 | ); 48 | } 49 | 50 | public function setUp() 51 | { 52 | 53 | } 54 | } 55 | 56 | class Child1713A extends Parent1713 57 | { 58 | 59 | } -------------------------------------------------------------------------------- /lib/Doctrine/I18n/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_I18n_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage I18n 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_I18n_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Pager/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Pager_Exception 24 | * 25 | * @author Guilherme Blanco 26 | * @package Doctrine 27 | * @subpackage Pager 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 0.9 32 | */ 33 | class Doctrine_Pager_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Adapter/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Adapter exception class 24 | * 25 | * @package Doctrine 26 | * @subpackage Adapter 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Adapter_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Registry/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Query_Registry_Exception extends Doctrine_Query_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Indexer/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Indexer 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Indexer_Exception extends Doctrine_Search_Exception 34 | { } -------------------------------------------------------------------------------- /tests/DataDictTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_DataDict_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_DataDict_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /tests/Cache/QuerySqliteTestCase.php: -------------------------------------------------------------------------------- 1 | connection->getAttribute(Doctrine_Core::ATTR_CACHE_DIR); 10 | 11 | if (file_exists($dir.DIRECTORY_SEPARATOR."stats.cache")) 12 | unlink($dir.DIRECTORY_SEPARATOR."stats.cache"); 13 | 14 | $this->cache = new Doctrine_Cache_Query_Sqlite($this->connection); 15 | $this->cache->deleteAll(); 16 | } 17 | 18 | public function testStore() { 19 | 20 | $this->cache->store("SELECT * FROM user", array(array('name' => 'Jack Daniels')), 60); 21 | $this->assertEqual($this->cache->count(), 1); 22 | 23 | $this->cache->store("SELECT * FROM group", array(array('name' => 'Drinkers club')), 60); 24 | 25 | $md5 = md5("SELECT * FROM user"); 26 | $result = $this->cache->fetch($md5); 27 | $this->assertEqual($result, array(array('name' => 'Jack Daniels'))); 28 | 29 | $md5 = md5("SELECT * FROM group"); 30 | $result = $this->cache->fetch($md5); 31 | $this->assertEqual($result, array(array('name' => 'Drinkers club'))); 32 | 33 | $this->assertEqual($this->cache->count(), 2); 34 | 35 | $this->cache->delete($md5); 36 | $this->assertEqual($this->cache->count(), 1); 37 | 38 | $this->cache->deleteAll(); 39 | $this->assertEqual($this->cache->count(), 0); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/Doctrine/Cli/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Cli exception class 24 | * 25 | * @package Doctrine 26 | * @subpackage Cli 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Cli_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Analyzer/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Analyzer_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | class Doctrine_Search_Analyzer_Exception extends Doctrine_Search_Exception 34 | { } -------------------------------------------------------------------------------- /tests/Ticket/DC36TestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Ticket_DC36_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Ticket_DC36_TestCase extends Doctrine_UnitTestCase 34 | { 35 | } -------------------------------------------------------------------------------- /tests/Import/MysqlTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Import_Mysql_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Import_Mysql_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /tests/Ticket/565TestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Ticket_565_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Ticket_565_TestCase extends Doctrine_UnitTestCase 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /lib/Doctrine/Node/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Node_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Node 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Joe Simms 32 | */ 33 | class Doctrine_Node_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Task/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Task_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Task 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 2761 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Task_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Data/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Data_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Data 27 | * @author Jonathan H. Wage 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 2552 $ 32 | */ 33 | class Doctrine_Data_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Record/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Record 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Record_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Relation/Parser/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Relation_Parser_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Relation 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision$ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Relation_Parser_Exception extends Doctrine_Relation_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Tree/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Tree_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Tree 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Tree_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/View/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_View_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage View 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | */ 33 | class Doctrine_View_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /tests/Expression/MssqlTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Mssql_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Expression_Mssql_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /tests/Expression/MysqlTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Mysql_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Expression_Mysql_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /tests/Expression/PgsqlTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Pgsql_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Expression_Pgsql_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /lib/Doctrine/Parser/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Parser_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Parser 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Jonathan H. Wage 32 | */ 33 | class Doctrine_Parser_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Query/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Query_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Query 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Query_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Search/Analyzer/Interface.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Search_Analyzer_Interface 24 | * 25 | * @package Doctrine 26 | * @subpackage Search 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @version $Revision$ 30 | * @link www.doctrine-project.org 31 | * @since 1.0 32 | */ 33 | interface Doctrine_Search_Analyzer_Interface 34 | { 35 | public function analyze($text); 36 | } -------------------------------------------------------------------------------- /tests/Expression/OracleTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Oracle_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Expression_Oracle_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /tests/Expression/SqliteTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Sqlite_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Expression_Sqlite_TestCase extends Doctrine_UnitTestCase { 34 | } 35 | -------------------------------------------------------------------------------- /lib/Doctrine/Export/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Export_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Export 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Export_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Manager/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Manager_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Manager 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Manager_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/RawSql/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_RawSql_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage RawSql 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_RawSql_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /tests/Cache/Query/SqliteTestCase.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Cache_Query_Sqlite_TestCase 24 | * 25 | * @package Doctrine 26 | * @author Konsta Vesterinen 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @category Object Relational Mapping 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | */ 33 | class Doctrine_Cache_Query_Sqlite_TestCase extends Doctrine_UnitTestCase 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /lib/Doctrine/Compiler/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Compiler_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Compiler 27 | * @author Konsta Vesterinen 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision: 7490 $ 32 | */ 33 | class Doctrine_Compiler_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/DataDict/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_DataDict_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage DataDict 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 7490 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_DataDict_Exception extends Doctrine_Exception 34 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Expression/Mock.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Expression_Mock 24 | * Mock driver that is used for testing purposes 25 | * 26 | * @package Doctrine 27 | * @subpackage Expression 28 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 29 | * @link www.doctrine-project.org 30 | * @since 1.0 31 | * @version $Revision$ 32 | * @author Konsta Vesterinen 33 | */ 34 | class Doctrine_Expression_Mock extends Doctrine_Expression_Driver 35 | { } -------------------------------------------------------------------------------- /lib/Doctrine/Hydrator/Exception.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Doctrine_Hydrator_Exception 24 | * 25 | * @package Doctrine 26 | * @subpackage Hydrate 27 | * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 28 | * @link www.doctrine-project.org 29 | * @since 1.0 30 | * @version $Revision: 1080 $ 31 | * @author Konsta Vesterinen 32 | */ 33 | class Doctrine_Hydrator_Exception extends Doctrine_Exception 34 | { } --------------------------------------------------------------------------------