当前位置: 首页>>代码示例>>PHP>>正文


PHP CakeTestFixture::init方法代码示例

本文整理汇总了PHP中CakeTestFixture::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeTestFixture::init方法的具体用法?PHP CakeTestFixture::init怎么用?PHP CakeTestFixture::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CakeTestFixture的用法示例。


在下文中一共展示了CakeTestFixture::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * Initializes this fixture class
  *
  * @return boolean
  */
 public function init()
 {
     if (empty($this->file)) {
         $this->file = Inflector::tableize($this->name) . '.sql';
     }
     return parent::init();
 }
开发者ID:theplankmeister,项目名称:cakephp-fixturize,代码行数:12,代码来源:SQLTestFixture.php

示例2: init

 /**
  * Initialize the fixture.
  *
  * @return void
  */
 public function init()
 {
     foreach ($this->records as $i => $recode) {
         $this->records[$i]['path'] = TMP . 'tests' . DS . 'file' . DS . $recode['id'] . DS;
     }
     parent::init();
 }
开发者ID:Onasusweb,项目名称:Files,代码行数:12,代码来源:FileFixture.php

示例3: init

 /**
  * {@inheritDoc}
  */
 public function init()
 {
     if (empty($this->fields)) {
         $this->fields = $this->getSchema($this->name);
     }
     parent::init();
 }
开发者ID:naow9y,项目名称:basercms,代码行数:10,代码来源:BaserTestFixture.php

示例4: init

 function init()
 {
     foreach ($this->records as $index => $record) {
         $this->records[$index]['created_on'] = date('Y-m-d H:m:s', strtotime($record['created_on']));
     }
     return parent::init();
 }
开发者ID:nachtschatt3n,项目名称:candycane,代码行数:7,代码来源:journal_fixture.php

示例5: init

 /**
  * Initialize the fixture.
  *
  * @return void
  */
 public function init()
 {
     for ($i = 101; $i <= 200; $i++) {
         $this->records[$i] = array('id' => $i, 'language_id' => '2', 'block_id' => $i, 'key' => 'announcement_' . $i, 'status' => '1', 'is_active' => '1', 'is_latest' => '1', 'content' => 'Announcements content ' . $i);
     }
     parent::init();
 }
开发者ID:go-to,项目名称:Announcements,代码行数:12,代码来源:AnnouncementFixture.php

示例6: init

 /**
  * Insert the first 35 users.
  */
 public function init()
 {
     $this->records = array();
     for ($i = 0; $i < 35; $i++) {
         $this->records[] = array('id' => $i + 1, 'user_id' => $i + 1, 'created' => '2014-12-03 15:00:00');
     }
     parent::init();
 }
开发者ID:nsystem1,项目名称:cwt,代码行数:11,代码来源:ApplicationFixture.php

示例7: init

 /**
  * Inserting 50 users.
  */
 public function init()
 {
     $this->records = array();
     for ($i = 0; $i < 50; $i++) {
         $stage = $i < 35 ? 'applied' : 'retired';
         $this->records[] = array('id' => $i + 1, 'username' => 'Player' . $i + 1, 'password' => '', 'md5password' => 'e77989ed21758e78331b20e477fc5582', 'admin' => false, 'stage' => $stage, 'timeline' => '00000000000000', 'participations' => 0, 'achievements' => 0, 'created' => '2014-12-03 15:00:00');
     }
     parent::init();
 }
开发者ID:nsystem1,项目名称:cwt,代码行数:12,代码来源:UserFixture.php

示例8: init

 /**
  * Initialize the fixture.
  *
  * @return void
  * @throws MissingModelException Whe importing from a model that does not exist.
  * @codeCoverageIgnore
  */
 public function init()
 {
     $default = array('plugin_key' => 'test_plugin', 'block_key' => 'test_block_paging_key', 'content_key' => 'test_contet_paging', 'comment' => 'Comment %s', 'created_user' => '1', 'created' => '2014-10-09 16:07:57');
     for ($i = 0; $i <= 100; $i++) {
         $comments = array_merge(array(), $default);
         $comments['comment'] = sprintf($comments['comment'], $i);
         $this->records[] = $comments;
     }
     parent::init();
 }
开发者ID:Onasusweb,项目名称:Comments,代码行数:17,代码来源:CommentFixture.php

示例9: init

 /**
  * Standings for eight groups.
  */
 public function init()
 {
     $this->records = array();
     $id = 1;
     for ($i = 0; $i < 8; $i++) {
         for ($k = 0; $k < 4; $k++) {
             $this->records[] = array('id' => $id, 'group_id' => $i + 1, 'user_id' => $id, 'points' => 0, 'games' => 0, 'game_ratio' => 0, 'round_ratio' => 0);
             $id++;
         }
     }
     parent::init();
 }
开发者ID:nsystem1,项目名称:cwt,代码行数:15,代码来源:StandingFixture.php

示例10: init

 function init()
 {
     foreach ($this->records as $index => $record) {
         $this->records[$index]['created_on'] = date('Y-m-d H:m:s', strtotime($record['created_on']));
         $this->records[$index]['updated_on'] = date('Y-m-d H:m:s', strtotime($record['updated_on']));
         $this->records[$index]['due_date'] = date('Y-m-d H:m:s', strtotime($record['due_date']));
         if (!empty($record['start_date'])) {
             $this->records[$index]['start_date'] = date('Y-m-d H:m:s', strtotime($record['start_date']));
         }
     }
     return parent::init();
 }
开发者ID:nachtschatt3n,项目名称:candycane,代码行数:12,代码来源:issue_fixture.php

示例11: init

 /**
  * Initialize the fixture.
  *
  * @return void
  */
 public function init()
 {
     foreach ($this->records as $i => $recode) {
         if ($recode['id'] !== '4') {
             $this->records[$i]['url'] = APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml';
         }
         if ($recode['id'] === '3') {
             $this->records[$i]['modified'] = date('Y-m-d H:i:s');
         }
     }
     parent::init();
 }
开发者ID:Onasusweb,项目名称:RssReaders,代码行数:17,代码来源:RssReaderFixture.php

示例12: init

 /**
  * {@inheritdoc}
  */
 public function init()
 {
     parent::init();
     $autoFill = isset($this->fields['created']) || isset($this->fields['modified']) || isset($this->fields['updated']);
     if (!empty($this->model)) {
         $Model = ClassRegistry::init($this->model);
         $stateable = $Model->Behaviors->attached('Stateable');
         var_dump($Model->alias);
     }
     if (empty($this->defaults) && !$autoFill) {
         return;
     }
     foreach ((array) $this->records as $k => $record) {
         $this->records[$k] += $this->defaults;
         foreach (array('created', 'modified', 'updated') as $field) {
             if (isset($this->fields[$field])) {
                 $this->records[$k] += array($field => date('Y-m-d H:i:s'));
             }
         }
     }
 }
开发者ID:gourmet,项目名称:common,代码行数:24,代码来源:CommonTestFixture.php

示例13: init

 public function init()
 {
     $this->records = array(array('id' => 1, 'member_id' => 1, 'admin_id' => 3, 'old_status' => 0, 'new_status' => 1, 'timestamp' => date('Y-m-d H:i:s')), array('id' => 2, 'member_id' => 4, 'admin_id' => 5, 'old_status' => 4, 'new_status' => 5, 'timestamp' => '2012-12-17 19:19:59'), array('id' => 3, 'member_id' => 3, 'admin_id' => 5, 'old_status' => 4, 'new_status' => 5, 'timestamp' => '2013-04-02 09:32:42'));
     parent::init();
 }
开发者ID:JodiWarren,项目名称:hms,代码行数:5,代码来源:StatusUpdateFixture.php

示例14: init

 public function init()
 {
     $this->records = array(array('id' => 1, 'role_name' => 'admin'), array('id' => 2, 'role_name' => 'test'));
     parent::init();
 }
开发者ID:simaostephanie,项目名称:Cloggy,代码行数:5,代码来源:CloggyUserRoleFixture.php

示例15: init

 public function init()
 {
     $records = array(array('username' => 'nombre1@gmail.com', 'password' => 'contrapassword1', 'first_name' => 'NombreUno', 'last_name' => 'ApellidoUno', 'gender' => 'M', 'birthday' => '1990-05-05'), array('username' => 'nombre2@gmail.com', 'password' => 'contrapassword2', 'first_name' => 'NombreDos', 'last_name' => 'ApellidoDos', 'gender' => 'M', 'birthday' => '1990-05-05'), array('username' => 'nombre3@gmail.com', 'password' => 'contrapassword3', 'first_name' => 'NombreTres', 'last_name' => 'ApellidoTres', 'gender' => 'F', 'birthday' => '1990-05-05'));
     parent::init();
 }
开发者ID:marcosj,项目名称:ProyectoIngenieria_1,代码行数:5,代码来源:UserFixture.php


注:本文中的CakeTestFixture::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。