protected function setUp()
 {
     parent::setUp();
     $this->databaseMap = new DatabaseMap('foodb');
     $this->tableName = 'foo';
     $this->tmap = new TableMap($this->tableName, $this->databaseMap);
 }
    public function setUp()
    {
        parent::setUp();
        if (!class_exists('ConcreteInheritanceBehaviorWithBehaviorExclusionTest\\ConcreteInheritanceParentQuery')) {
            $schema = <<<EOF
<database name="concrete_inheritance_behavior_exclusion" namespace="ConcreteInheritanceBehaviorWithBehaviorExclusionTest">
    <table name="concrete_inheritance_parent" allowPkInsert="true">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="title" type="VARCHAR" size="100" primaryString="true" />
        <behavior name="sluggable">
            <parameter name="scope_column" value="title" />
        </behavior>
        <behavior name="timestampable" />
        <index>
            <index-column name="title" />
        </index>
    </table>
    <table name="concrete_inheritance_child" allowPkInsert="true">
        <column name="body" type="longvarchar" />
        <column name="author_id" required="false" type="INTEGER" />
        <behavior name="concrete_inheritance">
            <parameter name="extends" value="concrete_inheritance_parent" />
            <parameter name="copy_data_to_child" value="slug" />
            <parameter name="exclude_behaviors" value="sluggable" />
        </behavior>
    </table>
</database>
EOF;
            QuickBuilder::buildSchema($schema);
        }
    }
 protected function setUp()
 {
     parent::setUp();
     $this->databaseMap = new DatabaseMap('foodb');
     $this->relationName = 'foo';
     $this->rmap = new RelationMap($this->relationName);
 }
Exemple #4
0
    protected function setUp()
    {
        parent::setUp();
        if (!class_exists('\\Nature')) {
            $schema = '
            <database>
                <table name="recherche" phpName="Recherche">
                    <column name="id" type="integer" primaryKey="true" autoIncrement="true"/>
                </table>

                <table name="recherche_nature" phpName="RechercheNature" isCrossRef="true">
                    <column name="recherche_id" type="integer" primaryKey="true"/>
                    <column name="nature_id" type="integer" primaryKey="true"/>
                    <foreign-key foreignTable="recherche" onDelete="cascade">
                        <reference local="recherche_id" foreign="id"/>
                    </foreign-key>
                    <foreign-key foreignTable="nature">
                        <reference local="nature_id" foreign="id"/>
                    </foreign-key>
                </table>

                <table name="nature" phpName="Nature">
                    <column name="id" type="integer" primaryKey="true" autoIncrement="true"/>
                </table>
            </database>
            ';
            QuickBuilder::buildSchema($schema);
        }
    }
 protected function setUp()
 {
     parent::setUp();
     Propel::init(__DIR__ . '/../../../../Fixtures/reverse/pgsql/build/conf/reverse-bookstore-conf.php');
     $this->con = Propel::getConnection('reverse-bookstore');
     $this->con->beginTransaction();
     if ('pgsql' !== $this->con->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
         $this->markTestSkipped('This test is designed for PostgreSQL');
     }
 }
 protected function setUp()
 {
     include __DIR__ . '/../../../Fixtures/reverse/mysql/build/conf/reverse-bookstore-conf.php';
     $this->con = Propel::getConnection('reverse-bookstore');
     $this->parser = new MysqlSchemaParser($this->con);
     $this->platform = new MysqlPlatform();
     $this->parser->setGeneratorConfig(new QuickGeneratorConfig());
     $this->parser->setPlatform($this->platform);
     parent::setUp();
 }
Exemple #7
0
 protected function setUp()
 {
     parent::setUp();
     if (!class_exists('\\Table829')) {
         $schema = '
         <database name="issue_829" defaultIdMethod="native">
             <table name="table829">
                 <column name="id" primaryKey="true" type="INTEGER" />
                 <column name="date" primaryKey="true" type="DATE" />
             </table>
         </database>
         ';
         QuickBuilder::buildSchema($schema);
     }
 }
 protected function setUp()
 {
     parent::setUp();
     Propel::init(__DIR__ . '/../../../../Fixtures/namespaced/build/conf/bookstore_namespaced-conf.php');
 }
    /**
     * Setup schema und some default data
     */
    public function setUp()
    {
        parent::setUp();
        if (!class_exists('MoreRelationTest\\Page')) {
            $schema = <<<EOF
<database name="more_relation_test" namespace="MoreRelationTest">

    <table name="more_relation_test_page" phpName="Page">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="title" type="VARCHAR" size="100" primaryString="true" />
    </table>

    <table name="more_relation_test_content" phpName="Content">
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
        <column name="title" type="VARCHAR" size="100" />
        <column name="content" type="LONGVARCHAR" required="false" />
        <column name="page_id" type="INTEGER" required="false" />
        <foreign-key foreignTable="more_relation_test_page" onDelete="cascade">
          <reference local="page_id" foreign="id"/>
        </foreign-key>
    </table>

    <table name="more_relation_test_comment" phpName="Comment">
        <column name="user_id" required="true" primaryKey="true" type="INTEGER" />
        <column name="page_id" required="true" primaryKey="true" type="INTEGER" />
        <column name="comment" type="VARCHAR" size="100" />
        <foreign-key foreignTable="more_relation_test_page" onDelete="cascade">
          <reference local="page_id" foreign="id"/>
        </foreign-key>
    </table>

    <table name="more_relation_test_content_comment" phpName="ContentComment">
        <column name="id" required="true" autoIncrement="true" primaryKey="true" type="INTEGER" />
        <column name="content_id" type="INTEGER" />
        <column name="comment" type="VARCHAR" size="100" />
        <foreign-key foreignTable="more_relation_test_content" onDelete="setnull">
          <reference local="content_id" foreign="id"/>
        </foreign-key>
    </table>

</database>
EOF;
            $builder = new QuickBuilder();
            $builder->setSchema($schema);
            $builder->build();
        }
        \MoreRelationTest\ContentCommentQuery::create()->doDeleteAll();
        \MoreRelationTest\ContentQuery::create()->doDeleteAll();
        \MoreRelationTest\CommentQuery::create()->doDeleteAll();
        \MoreRelationTest\PageQuery::create()->doDeleteAll();
        for ($i = 1; $i <= 2; $i++) {
            $page = new \MoreRelationTest\Page();
            $page->setTitle('Page ' . $i);
            for ($j = 1; $j <= 3; $j++) {
                $content = new \MoreRelationTest\Content();
                $content->setTitle('Content ' . $j);
                $content->setContent(str_repeat('Content', $j));
                $page->addContent($content);
                $comment = new \MoreRelationTest\Comment();
                $comment->setUserId($j);
                $comment->setComment(str_repeat('Comment', $j));
                $page->addComment($comment);
                $comment = new \MoreRelationTest\ContentComment();
                $comment->setContentId($i * $j);
                $comment->setComment(str_repeat('Comment-' . $j . ', ', $j));
                $content->addContentComment($comment);
            }
            $page->save();
        }
    }
Exemple #10
0
 protected function setUp()
 {
     parent::setUp();
     include_once __DIR__ . '/ActiveRecordTestClasses.php';
 }
 protected function setUp()
 {
     parent::setUp();
     Propel::init(__DIR__ . '/../../../../Fixtures/reverse/mysql/build/conf/reverse-bookstore-conf.php');
 }
 public function setUp()
 {
     parent::setUp();
     $schemaTool = new SchemaTool($this->entityManager);
     $schemaTool->createSchema(array(self::$metadata));
 }
 protected function setUp()
 {
     parent::setUp();
     require_once __DIR__ . '/../../../../Fixtures/behavior-installer/src/gossi/propel/behavior/l10n/L10nBehavior.php';
     require_once __DIR__ . '/../../../../Fixtures/behavior-development/src/CollectionBehavior.php';
 }
 protected function setUp()
 {
     parent::setUp();
 }