• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CakeTestFixture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 /**
  * Override the normal CakeTestFixture::__construct() to get the name
  * from our pattern
  *
  * @author David Kullmann
  */
 public function __construct()
 {
     $class = get_class($this);
     if ($this->name === null) {
         if (preg_match('/^Elastic(.*)Fixture$/', $class, $matches)) {
             $this->name = $matches[1];
         } else {
             throw new Exception("ElasticFixtures should have the naming pattern Elastic<Model>Fixture ('{$class}' given)");
         }
     }
     return parent::__construct();
 }
开发者ID:el-barto,项目名称:cakephp-elastic-search-datasource,代码行数:18,代码来源:ElasticFixture.php


示例2: __construct

 /**
  * Constructor.
  *
  *  Generates dynamic records.
  *
  * @return void
  */
 public function __construct()
 {
     $this->records[] = ['id' => 2, 'task' => 'Example', 'data' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'not_before' => '2014-12-19 17:12:30', 'fetched' => '2014-12-19 17:12:30', 'completed' => date('Y-m-d H:i:s', strtotime('+1 minute')), 'failed_count' => 1, 'failure_message' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'worker_key' => 'Lorem ipsum dolor sit amet', 'created' => '2014-12-19 17:12:30'];
     $this->records[] = ['id' => 3, 'task' => 'Example', 'data' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'not_before' => '2014-12-19 17:12:30', 'fetched' => '2014-12-19 17:12:30', 'completed' => date('Y-m-d H:i:s', strtotime('-15 minute')), 'failed_count' => 1, 'failure_message' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'worker_key' => 'Lorem ipsum dolor sit amet', 'created' => '2014-12-19 17:12:30'];
     $this->records[] = ['id' => 4, 'task' => 'Example', 'data' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'not_before' => '2014-12-19 17:12:30', 'fetched' => '2014-12-19 17:12:30', 'completed' => date('Y-m-d H:i:s', strtotime('-5 minute')), 'failed_count' => 1, 'failure_message' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', 'worker_key' => 'Lorem ipsum dolor sit amet', 'created' => '2014-12-19 17:12:30'];
     parent::__construct();
 }
开发者ID:oefenweb,项目名称:cakephp-queue,代码行数:14,代码来源:QueuedTaskFixture.php


示例3: __construct

    public function __construct(&$db)
    {
        parent::__construct($db);
        $config_dump = <<<EOT
---
use_autoreload: "0"
reverse_mode: "0"
autoreload: "60"
prefetch_num: "2"
limit_subs: "100"
use_pinsaver: "1"
wait: "200"
scroll_px: "100"
touch_when: onload
max_view: "200"
scroll_type: px
use_scroll_hilight: "0"
use_wait: "0"
max_pin: "5"
use_limit_subs: "0"
ApiKey: BAh7CToMY3NyZl9pZCIlMTRmZWMwNTgzNmE0NmZmYjg5NDIxNDlhOTFjZjY1%0AYjQ6C21lbWJlcmkGOg5yZXR1cm5fdG8wIgpmbGFzaElDOidBY3Rpb25Db250%0Acm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--79720c7867f3e5b1ababf83097803a8fc8ccc08f
items_per_page: "20"
default_public_status: "1"
use_prefetch_hack: "0"
current_font: "14"
EOT;
        $this->records = array(array('id' => 1, 'username' => 'quentin', 'email' => '[email protected]', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'created_on' => date('Y-m-d H:i:s', strtotime('-5 days'))), array('id' => 2, 'username' => 'aaron', 'email' => '[email protected]', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'created_on' => date('Y-m-d H:i:s', strtotime('-1 days'))), array('id' => 3, 'username' => 'mala', 'email' => '[email protected]', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'config_dump' => $config_dump, 'public' => 1, 'created_on' => date('Y-m-d H:i:s', strtotime('-1 days'))));
    }
开发者ID:kaz0636,项目名称:openflp,代码行数:28,代码来源:member_fixture.php


示例4: 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


示例5: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['passwd'] = Security::hash($record['passwd'], null, true);
     }
 }
开发者ID:radig,项目名称:comments,代码行数:11,代码来源:UserFixture.php


示例6: init

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


示例7: 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


示例8: foreach

 function __construct()
 {
     foreach ($this->records as &$record) {
         $record['file_name'] = CAKE . $record['file_name'];
     }
     parent::__construct();
 }
开发者ID:abhishek-xicom,项目名称:api_generator,代码行数:7,代码来源:ApiClassFixture.php


示例9: __construct

 /**
  * Constructor
  *
  * @return CartFixture
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['additional_data'] = serialize($record['additional_data']);
     }
 }
开发者ID:mikebirch,项目名称:cakephp-cart-plugin,代码行数:12,代码来源:CartFixture.php


示例10: CakeSchema

 function __construct()
 {
     parent::__construct();
     $Schema = new CakeSchema(array('name' => 'Chaw'));
     $Schema = $Schema->load();
     $this->fields = $Schema->tables['projects'];
 }
开发者ID:Theaxiom,项目名称:chaw-source,代码行数:7,代码来源:project_fixture.php


示例11: 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


示例12: __construct

 /**
  * Constructor
  *
  * @return OrderFixture
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['cart_snapshot'] = serialize($record['cart_snapshot']);
     }
 }
开发者ID:mikebirch,项目名称:cakephp-cart-plugin,代码行数:12,代码来源:OrderFixture.php


示例13: __construct

 public function __construct()
 {
     foreach ($this->records as &$row) {
         $row['id'] = String::uuid();
     }
     parent::__construct();
 }
开发者ID:nodesagency,项目名称:Translations,代码行数:7,代码来源:TranslationFixture.php


示例14: foreach

 function __construct()
 {
     foreach ($this->records as &$record) {
         $record['file_name'] = TEST_CAKE_CORE_INCLUDE_PATH . $record['file_name'];
     }
     parent::__construct();
 }
开发者ID:predominant,项目名称:api_generator,代码行数:7,代码来源:api_class_fixture.php


示例15: __construct

 /**
  * This is how we initialize this class
  * note that we pass in the fixture by reference
  * so all modifications done to it are automatically done
  * outside of the scope of this class (sweet, no returning)
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     if (is_subclass_of($this, 'AppTestFixture')) {
         $parentClass = get_parent_class($this);
         $parentVars = get_class_vars($parentClass);
         if (isset($parentVars['fields'])) {
             $this->fields = array_merge($this->fields, $parentVars['fields']);
         }
         if (isset($parentVars['records'])) {
             $this->records = array_merge($this->records, $parentVars['records']);
         }
         if (isset($parentVars['options'])) {
             $this->options = array_merge($this->options, $parentVars['options']);
         }
     }
     // trigger callbacks: before
     if (method_exists($this, 'beforeRecords')) {
         $this->beforeRecords();
     }
     // do stuff
     if ($this->options['fix']) {
         $this->fixFields();
     }
     if ($this->options['dates']) {
         $this->cleanupDates();
     }
     // trigger callbacks: after
     if (method_exists($this, 'afterRecords')) {
         $this->afterRecords();
     }
 }
开发者ID:beckye67,项目名称:Icing,代码行数:39,代码来源:AppTestFixture.php


示例16: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['password'] = BcryptFormAuthenticate::hash($record['password'], null, true);
     }
 }
开发者ID:Adnan0703,项目名称:users-plugin,代码行数:11,代码来源:UserFixture.php


示例17: insert

 /**
  * insert
  *
  * @param Object $db
  * @return array
  */
 public function insert($db)
 {
     $result = parent::insert($db);
     if ($result === true && $db instanceof Postgres) {
         $this->_fixSequence($db);
     }
     return $result;
 }
开发者ID:laiello,项目名称:plankonindia,代码行数:14,代码来源:CroogoTestFixture.php


示例18: 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


示例19: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->User = ClassRegistry::init('Users.User');
     foreach ($this->records as &$record) {
         $record['password'] = $this->User->hash($record['password'], null, true);
     }
 }
开发者ID:harpax,项目名称:users,代码行数:12,代码来源:UserFixture.php


示例20: create

 function create(&$db)
 {
     $result = parent::create($db);
     if ($result) {
         $db->execute('ALTER TABLE `items` CHANGE `provider_key` `provider_key` BIGINT( 20 ) NULL DEFAULT NULL ');
     }
     return $result;
 }
开发者ID:rchavik,项目名称:20Couch,代码行数:8,代码来源:item_fixture.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CakeTestModel类代码示例发布时间:2022-05-20
下一篇:
PHP CakeTestCase类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap