コード例 #1
0
ファイル: member_fixture.php プロジェクト: kaz0636/openflp
    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' => '*****@*****.**', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'created_on' => date('Y-m-d H:i:s', strtotime('-5 days'))), array('id' => 2, 'username' => 'aaron', 'email' => '*****@*****.**', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'created_on' => date('Y-m-d H:i:s', strtotime('-1 days'))), array('id' => 3, 'username' => 'mala', 'email' => '*****@*****.**', 'salt' => '7e3041ebc2fc05a40c60028e2c4901a81035d3cd', 'crypted_password' => '00742970dc9e6319f8019fd54864d3ea740f04b1', 'config_dump' => $config_dump, 'public' => 1, 'created_on' => date('Y-m-d H:i:s', strtotime('-1 days'))));
    }
コード例 #2
0
 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['password'] = BcryptFormAuthenticate::hash($record['password'], null, true);
     }
 }
コード例 #3
0
 function __construct()
 {
     foreach ($this->records as &$record) {
         $record['file_name'] = CAKE . $record['file_name'];
     }
     parent::__construct();
 }
コード例 #4
0
 function __construct()
 {
     parent::__construct();
     $Schema = new CakeSchema(array('name' => 'Chaw'));
     $Schema = $Schema->load();
     $this->fields = $Schema->tables['projects'];
 }
コード例 #5
0
ファイル: AppTestFixture.php プロジェクト: beckye67/Icing
 /**
  * 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();
     }
 }
コード例 #6
0
ファイル: UserFixture.php プロジェクト: radig/comments
 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['passwd'] = Security::hash($record['passwd'], null, true);
     }
 }
コード例 #7
0
 /**
  * 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();
 }
コード例 #8
0
 /**
  * Constructor
  *
  * @return OrderFixture
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['cart_snapshot'] = serialize($record['cart_snapshot']);
     }
 }
コード例 #9
0
 /**
  * Constructor
  *
  * @return CartFixture
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['additional_data'] = serialize($record['additional_data']);
     }
 }
コード例 #10
0
 public function __construct()
 {
     foreach ($this->records as &$row) {
         $row['id'] = String::uuid();
     }
     parent::__construct();
 }
コード例 #11
0
 function __construct()
 {
     foreach ($this->records as &$record) {
         $record['file_name'] = TEST_CAKE_CORE_INCLUDE_PATH . $record['file_name'];
     }
     parent::__construct();
 }
コード例 #12
0
ファイル: UserFixture.php プロジェクト: harpax/users
 /**
  * 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);
     }
 }
コード例 #13
0
 /**
  * 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();
 }
コード例 #14
0
 public function __construct(&$db)
 {
     parent::__construct($db);
     $this->records = array(array('id' => 1, 'member_id' => 1, 'feed_id' => 1), array('id' => 2, 'member_id' => 1, 'feed_id' => 2));
 }
コード例 #15
0
ファイル: dir_fixture.php プロジェクト: kaz0636/openflp
 public function __construct(&$db)
 {
     parent::__construct($db);
     $this->records = array(array('id' => 1, 'member_id' => 1, 'name' => 'test'), array('id' => 2, 'member_id' => 1, 'name' => 'test2'));
 }
コード例 #16
0
 /**
  * Apply any necessary runtime settings to the data.
  */
 public function __construct()
 {
     parent::__construct();
     $this->records[1]['last_login_at'] = (new DateTime())->format('Y-m-d H:i:s');
     $this->records[2]['last_login_at'] = (new DateTime())->format('Y-m-d H:i:s');
 }
コード例 #17
0
ファイル: pin_fixture.php プロジェクト: kaz0636/openflp
 public function __construct(&$db)
 {
     parent::__construct($db);
     $this->records = array(array('id' => 1, 'member_id' => 1, 'link' => 'http://example.com/article/1'), array('id' => 2, 'member_id' => 1, 'link' => 'http://example.com/article/2'));
 }
コード例 #18
0
 public function __construct()
 {
     $now = new DateTime(null, new DateTimeZone('UTC'));
     $this->records = array(array('id' => 'contact1', 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'addressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Lars', 'lastName' => 'Kneschke')))), array('id' => sha1(mt_rand() . microtime()), 'class' => 'Syncroton_Model_Contact', 'folder_id' => 'anotherAddressbookFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Contact(array('firstName' => 'Cornelius', 'lastName' => 'Weiß')))), array('id' => 'email1', 'class' => 'Syncroton_Model_Email', 'folder_id' => 'emailInboxFolderId', 'creation_time' => $now->format("Y-m-d H:i:s"), 'data' => serialize(new Syncroton_Model_Email(array('accountId' => 'FooBar', 'attachments' => array(new Syncroton_Model_EmailAttachment(array('fileReference' => '12345abcd', 'umAttOrder' => 1))), 'categories' => array('123', '456'), 'cc' => '*****@*****.**', 'dateReceived' => new DateTime('2012-03-21 14:00:00', new DateTimeZone('UTC')), 'from' => '*****@*****.**', 'subject' => 'Test Subject', 'to' => '*****@*****.**', 'read' => 1, 'body' => new Syncroton_Model_EmailBody(array('type' => Syncroton_Model_EmailBody::TYPE_PLAINTEXT, 'data' => 'Hello!', 'truncated' => true, 'estimatedDataSize' => 600)))))));
     parent::__construct();
 }
コード例 #19
0
ファイル: feed_fixture.php プロジェクト: kaz0636/openflp
 public function __construct(&$db)
 {
     parent::__construct($db);
     $this->records = array(array('id' => 1, 'feedlink' => 'http://example.com/rss1', 'subscribers_count' => 16), array('id' => 2, 'feedlink' => 'http://example.com/rss2', 'subscribers_count' => 32));
 }