當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CakeTestFixture類代碼示例

本文整理匯總了PHP中CakeTestFixture的典型用法代碼示例。如果您正苦於以下問題:PHP CakeTestFixture類的具體用法?PHP CakeTestFixture怎麽用?PHP CakeTestFixture使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CakeTestFixture類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

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

示例2: __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' => 'quentin@example.com', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'created_on' => date('Y-m-d H:i:s', strtotime('-5 days'))), array('id' => 2, 'username' => 'aaron', 'email' => 'aaron@example.com', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'created_on' => date('Y-m-d H:i:s', strtotime('-1 days'))), array('id' => 3, 'username' => 'mala', 'email' => 'mala@example.com', '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

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

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

示例5: init

 /**
  * {@inheritDoc}
  */
 public function init()
 {
     if (empty($this->fields)) {
         $this->fields = $this->getSchema($this->name);
     }
     parent::init();
 }
開發者ID:naow9y,項目名稱:basercms,代碼行數:10,代碼來源:BaserTestFixture.php

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

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

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

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

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

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

示例12: __construct

 public function __construct()
 {
     foreach ($this->records as &$row) {
         $row['id'] = String::uuid();
     }
     parent::__construct();
 }
開發者ID:nodesagency,項目名稱:Translations,代碼行數:7,代碼來源:TranslationFixture.php

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

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

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


注:本文中的CakeTestFixture類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。