Exemplo n.º 1
2
 /**
  * Runs the drop and create commands on the fixtures if necessary.
  *
  * @param \Cake\TestSuite\Fixture\TestFixture $fixture the fixture object to create
  * @param Connection $db the datasource instance to use
  * @param array $sources The existing tables in the datasource.
  * @param bool $drop whether drop the fixture if it is already created or not
  * @return void
  */
 protected function _setupTable(TestFixture $fixture, Connection $db, array $sources, $drop = true)
 {
     if (!empty($fixture->created) && in_array($db->configName(), $fixture->created)) {
         return;
     }
     $table = $fixture->table;
     $exists = in_array($table, $sources);
     if ($drop && $exists) {
         $fixture->drop($db);
         $fixture->create($db);
     } elseif (!$exists) {
         $fixture->create($db);
     } else {
         $fixture->created[] = $db->configName();
         $fixture->truncate($db);
     }
 }
Exemplo n.º 2
0
 public function init()
 {
     //  id, name, created, modified
     $dbDump = '
         1,Production Demand Pull Factor (exportable demand per capita),2013-09-24 19:33:12,2013-09-24 19:33:12
         2,Production Supply Pull Factor (exportable supply per capita),2013-09-24 19:39:29,2013-09-24 19:39:29
         3,2011 Wholesale Personal Income per Capita Pull Factor,2013-09-24 19:39:37,2013-09-24 19:39:37
         4,Total Establishments: Wholesale Trade per Capita Pull Factor,2013-09-24 19:39:45,2013-09-24 19:39:45
         5,2012 Truck Transportation Personal Income per Capita Pull Factor,2013-09-24 19:39:53,2013-09-24 19:39:53
         6,Retail Supply Pull Factor (non-exportable supply per capita),2013-09-24 19:40:01,2013-09-24 19:40:01
         7,Retail Demand Pull Factor (non-exportable demand per capita),2013-09-24 19:40:10,2013-09-24 19:40:10
         8,Total Establishments: Retail Trade per Capita Pull Factor,2013-09-24 19:40:21,2013-09-24 19:40:21
         9,Housing Density (units per square mile) Pull Factor,2013-09-24 19:40:27,2013-09-24 19:40:27
         10,Metro Dummy Pull factor,2013-09-24 19:40:34,2013-09-24 19:40:34
         11,2001-2011 Population Growth Pull Factor,2013-09-24 19:40:43,2013-09-24 19:40:43
         12,Median House Value Pull Factor,2013-09-24 19:40:50,2013-09-24 19:40:50
         13,Index of Changeable Amenities Pull Factor,2013-09-24 19:40:56,2013-09-24 19:40:56
         14,Index of Relatively Static Amenities Pull Factor,2013-09-24 19:41:04,2013-09-24 19:41:04
         15,2011 Percentage of 25 Yr & Older Population that have a Bachelor Degree or Higher Pull Factor,2013-09-24 19:41:11,2013-09-24 19:41:11
         16,Total Establishments: Arts Entertainment Recreation per Capita Pull Factor,2013-09-24 19:41:18,2013-09-24 19:41:18
         17,2011 Percentage of Total Population under 30 years Pull Factor,2013-09-24 19:41:24,2013-09-24 19:41:24
         18,Exportable Sector Employment,2013-10-07 14:05:24,2013-10-07 14:05:24
         19,Non-Exportable Sector Employment,2013-10-07 14:05:24,2013-10-07 14:05:24
     ';
     $lines = explode("\n", $dbDump);
     foreach ($lines as $lineNum => $line) {
         $line = trim($line);
         if ($line == '') {
             continue;
         }
         $fields = explode(',', $line);
         $this->records[] = ['id' => $fields[0], 'name' => $fields[1], 'created' => $fields[2], 'modified' => $fields[3]];
     }
     parent::init();
 }
Exemplo n.º 3
0
 public function init()
 {
     parent::init();
     // 1. Not all fixtures want to use the dev db.
     if (is_null($this->tableName)) {
         return;
     }
     // 2. We need to do this to ensure that the tables really do use the connection to the
     // dev db.
     TableRegistry::remove($this->tableName);
     $table = TableRegistry::get($this->tableName, ['connection' => ConnectionManager::get('dev')]);
     //if(!is_null($this->joinTableName)) {
     //TableRegistry::remove($this->joinTableName);
     //$n=TableRegistry::get($this->joinTableName, ['connection' => ConnectionManager::get('fixture')]);
     //}
     // 3. Now build the query to retrieve the source records
     $query = new Query(ConnectionManager::get('dev'), $table);
     $query->find('all');
     //if(!is_null($this->order)) $query->order($this->order);
     //if(!is_null($this->joinTableName)) $query->leftJoin($this->joinTableName,'semesters.id = sections.semester_id');
     //$c=$query->count();
     // 4. Copy the records
     /* @var \Cake\ORM\Entity $record */
     foreach ($query as $record) {
         $this->records[] = $record->toArray();
     }
     // 5. Do this again to ensure that the table uses the 'test' connection.
     TableRegistry::remove($this->tableName);
     TableRegistry::get($this->tableName, ['connection' => ConnectionManager::get('test')]);
     //if(!is_null($this->joinTableName)) {
     //TableRegistry::remove($this->joinTableName);
     //TableRegistry::get($this->joinTableName, ['connection' => ConnectionManager::get('test')]);
     //}
 }
Exemplo n.º 4
0
 public function init()
 {
     $password = (new DefaultPasswordHasher())->hash('testpassword');
     $this->records[] = ['id' => 1, 'name' => 'Member User', 'email' => '*****@*****.**', 'password' => $password, 'role' => 'user', 'profile' => '**Test User 1\'s** profile', 'slug' => 'test-user-1', 'stripe_customer_id' => null, 'created' => '2016-02-07 00:14:55', 'modified' => '2016-02-07 00:14:55'];
     $this->records[] = ['id' => 2, 'name' => 'Non-Member User', 'email' => '*****@*****.**', 'password' => $password, 'role' => 'user', 'profile' => '**Test User 2\'s** profile', 'slug' => 'test-user-2', 'stripe_customer_id' => null, 'created' => '2016-02-07 00:14:55', 'modified' => '2016-02-07 00:14:55'];
     $this->records[] = ['id' => 3, 'name' => 'Admin User', 'email' => '*****@*****.**', 'password' => $password, 'role' => 'admin', 'profile' => '**Admin User\'s** profile', 'slug' => 'admin-user', 'stripe_customer_id' => null, 'created' => '2016-02-07 00:14:55', 'modified' => '2016-02-07 00:14:55'];
     parent::init();
 }
Exemplo n.º 5
0
 public function init()
 {
     $created = $modified = date('Y-m-d H:i:s');
     array_walk($this->records, function (&$record) use($created, $modified) {
         $record += compact('created');
     });
     parent::init();
 }
Exemplo n.º 6
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
     foreach ($this->records as &$record) {
         $record['passwd'] = sha1($record['passwd']);
         //, null, true
     }
 }
Exemplo n.º 7
0
 /**
  * Add check constraints.
  *
  * @param ConnectionInterface $db
  * @return boolean
  */
 public function create(ConnectionInterface $db)
 {
     $result = parent::create($db);
     $sql = ['ALTER TABLE "comments" ADD CONSTRAINT "comments_status_in_list" CHECK(cakephp_validate_in_list("status", ARRAY[\'awaiting\', \'ham\', \'spam\']));', 'ALTER TABLE "comments" ADD CONSTRAINT "comments_name_min_length" CHECK(cakephp_validate_min_length("name", 4));', 'ALTER TABLE "comments" ADD CONSTRAINT "comments_name_alpha_numeric" CHECK(cakephp_validate_alpha_numeric("name"));'];
     foreach ($sql as $stmt) {
         $db->query($stmt);
     }
     return $result;
 }
Exemplo n.º 8
0
 /**
  * Records
  *
  * @var array
  */
 public function init()
 {
     $stoppedAt = new Time();
     $startedAt = clone $stoppedAt;
     $startedAt->modify('-2 hours');
     $stoppedAt2 = new Time();
     $startedAt2 = clone $stoppedAt2;
     $startedAt2->modify('-45 seconds');
     $this->records = [['id' => 1, 'started_at' => $startedAt, 'stopped_at' => $stoppedAt, 'trackable_id' => 1, 'trackable_type' => 'Todos', 'created' => '2015-10-09 13:19:39', 'modified' => '2015-10-09 13:19:39'], ['id' => 2, 'started_at' => $startedAt, 'stopped_at' => $stoppedAt, 'trackable_id' => 2, 'trackable_type' => 'Todos', 'created' => '2015-10-09 13:19:39', 'modified' => '2015-10-09 13:19:39'], ['id' => 3, 'started_at' => $startedAt2, 'stopped_at' => $stoppedAt2, 'trackable_id' => 2, 'trackable_type' => 'Todos', 'created' => '2015-10-09 13:19:39', 'modified' => '2015-10-09 13:19:39'], ['id' => 4, 'started_at' => '2015-10-14T13:50:21-0300', 'stopped_at' => '2015-10-14T18:50:21-0300', 'trackable_id' => 1, 'trackable_type' => 'Todos', 'created' => '2015-10-14T13:50:21-0300', 'modified' => '2015-10-14T18:50:21-0300'], ['id' => 5, 'started_at' => $startedAt2, 'stopped_at' => $stoppedAt2, 'trackable_id' => 3, 'trackable_type' => 'Todos', 'created' => '2015-10-09 13:19:39', 'modified' => '2015-10-09 13:19:39']];
     parent::init();
 }
Exemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 public function insert(Connection $db)
 {
     if (!parent::insert($db)) {
         return false;
     }
     $entityPopulator = new EntityPopulator($this->table);
     $populator = new Populator($this->faker);
     array_walk($this->guessers, array($populator, 'addGuesser'));
     $populator->addEntity($entityPopulator, $this->number, $this->customColumnFormatters, $this->customModifiers);
     $populator->execute(['validate' => false]);
     return true;
 }
Exemplo n.º 10
0
 /**
  * Drops the table from the test datasource
  *
  * @param ConnectionInterface $db
  * @return void
  */
 public function drop(ConnectionInterface $db)
 {
     unset(static::$_tableHashes[$this->table]);
     return parent::drop($db);
 }
 /**
  * method init
  * 
  * @return void
  */
 public function init()
 {
     $this->records = [['title' => 'The title', 'slug' => 'the-title', 'body' => 'This is the article body.', 'created' => '2015-03-03 16:33:57', 'user_id' => 1], ['title' => 'A title once again', 'slug' => 'a-title-once-again', 'body' => 'And the article body follows.', 'created' => '2015-03-03 16:35:37', 'user_id' => 1], ['title' => 'Title strikes back', 'slug' => 'title-strikes-back', 'body' => 'This is really exciting! Not.', 'created' => '2015-03-03 16:39:22', 'user_id' => 2]];
     parent::init();
 }
 /**
  * Records
  *
  * @var array
  */
 public function init()
 {
     $this->records = [['id' => 1, 'ref' => 'Posts', 'ref_id' => 1, 'file' => 'img' . DS . 'upload' . DS . '2015' . DS . '08' . DS . 'testHelper.png', 'name' => 'Lorem ipsum dolor sit amet', 'position' => 0, 'caption' => '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.'], ['id' => 2, 'ref' => 'Posts', 'ref_id' => 1, 'file' => 'img' . DS . 'upload' . DS . '2015' . DS . '08' . DS . 'testHelper_50x50.jpg', 'name' => 'Lorem ipsum dolor sit amet', 'position' => 0, 'caption' => '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.'], ['id' => 3, 'ref' => 'Posts', 'ref_id' => 2, 'file' => 'img' . DS . 'upload' . DS . '2015' . DS . '08' . DS . 'document.pdf', 'name' => 'Lorem ipsum dolor sit amet', 'position' => 1, 'caption' => '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.'], ['id' => 4, 'ref' => 'Pages', 'ref_id' => 2, 'file' => 'img' . DS . 'upload' . DS . '2015' . DS . '08' . DS . 'testHelper.png', 'name' => 'Lorem ipsum dolor sit amet', 'position' => 1, 'caption' => '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.']];
     parent::init();
 }
Exemplo n.º 13
0
 public function init()
 {
     $this->records = [['nome' => 'caneta', 'valor' => 12.5], ['id' => 2, 'nome' => 'borracha', 'valor' => 15.5]];
     parent::init();
 }
Exemplo n.º 14
0
 /**
  * Runs the drop and create commands on the fixtures if necessary.
  *
  * @param \Cake\TestSuite\Fixture\TestFixture $fixture the fixture object to create
  * @param Connection $db the datasource instance to use
  * @param bool $drop whether drop the fixture if it is already created or not
  * @return void
  */
 protected function _setupTable(TestFixture $fixture, Connection $db = null, $drop = true)
 {
     if (!$db) {
         if (!empty($fixture->connection)) {
             $db = ConnectionManager::get($fixture->connection, false);
         }
         if (!$db) {
             $db = ConnectionManager::get('test', false);
         }
     }
     if (!empty($fixture->created) && in_array($db->configName(), $fixture->created)) {
         return;
     }
     $schemaCollection = $db->schemaCollection();
     $sources = (array) $schemaCollection->listTables();
     $table = $fixture->table;
     $exists = in_array($table, $sources);
     if ($drop && $exists) {
         $fixture->drop($db);
         $fixture->create($db);
     } elseif (!$exists) {
         $fixture->create($db);
     } else {
         $fixture->created[] = $db->configName();
     }
 }
Exemplo n.º 15
0
 /**
  * Records
  *
  * @var array
  */
 public function init()
 {
     $this->records = [['id' => 1, 'hash' => '31f7a65e315586ac198bd798b6629ce4903d0899476d5741a9f32e2e521b6a66', 'used' => 0, 'time' => 86400, 'created' => date('Y-m-d H:i:s'), 'user_id' => 1, 'hash_type_id' => 1], ['id' => 2, 'hash' => 'cce66316b4c1c59df94a35afb80cecd82d1a8d91b554022557e115f5c275f515', 'used' => 1, 'time' => 86400, 'created' => date('Y-m-d H:i:s'), 'user_id' => 1, 'hash_type_id' => 1], ['id' => 3, 'hash' => 'eb0295d98f37ae9e95102afae792d540137be2dedf6c4b00570ab1d1f355d033', 'used' => 0, 'time' => 86400, 'created' => '2007-03-18 10:39:23', 'user_id' => 1, 'hash_type_id' => 1], ['id' => 4, 'hash' => 'd1c7c99c6e2e7b311f51dd9d19161a5832625fb21f35131fba6da62513f0c099', 'used' => 0, 'time' => 86400, 'created' => date('Y-m-d H:i:s'), 'user_id' => 1, 'hash_type_id' => 2]];
     parent::init();
 }
Exemplo n.º 16
0
 public function init()
 {
     $this->records = [['ip' => '192.193.194.195', 'url' => 'users/login', 'expire' => strtotime('+5 minutes')], ['ip' => '188.189.190.191', 'url' => 'users/login', 'expire' => strtotime('+1 minutes')], ['ip' => '188.189.190.191', 'url' => 'users', 'expire' => strtotime('+2 minutes')], ['ip' => '188.189.190.191', 'url' => 'users/login', 'expire' => strtotime('+4 minutes')]];
     parent::init();
 }
Exemplo n.º 17
0
 public function init()
 {
     // stat_category_id    value   year    created     modified
     $dbDump = [1 => '
             1,0.6,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             2,0.5,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             3,0.33,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             4,0.71,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             5,0.52,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             6,0.8,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             7,0.7,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             8,1.11,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             9,3.64,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             10,1,NULL,2013-10-01 19:53:34,,2013-10-01 19:53:34
             11,-0.23,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             12,0.49,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             13,1.07,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             14,0.86,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             15,0.8,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             16,0.94,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             17,1.11,NULL,2013-10-01 19:53:34,2013-10-01 19:53:34
             18,27169,1969,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,25895,1970,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,24362,1971,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,23612,1972,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,24560,1973,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,24641,1974,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,21398,1975,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,21608,1976,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,22757,1977,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,22228,1978,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,22687,1979,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,20955,1980,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,19999,1981,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,17671,1982,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,17597,1983,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,18680,1984,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,18883,1985,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,19138,1986,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,19317,1987,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,19741,1988,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,19862,1989,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,20440,1990,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,20013,1991,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,22346,1992,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,21980,1993,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,23215,1994,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,24280,1995,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,22177,1996,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,21440,1997,2013-10-07 20:19:13,2013-10-07 20:19:13
             18,21011,1998,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,20884,1999,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,20627,2000,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,19832,2001,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,17422,2002,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,16417,2003,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,15876,2004,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,14918,2005,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,14681,2006,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,14594,2007,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,13920,2008,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,12439,2009,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,11832,2010,2013-10-07 20:19:14,2013-10-07 20:19:14
             18,12182,2011,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,18921,1969,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,19336,1970,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,20065,1971,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,20801,1972,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,21486,1973,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,21597,1974,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,21556,1975,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,22250,1976,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,23407,1977,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,24463,1978,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,25271,1979,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,25327,1980,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,25679,1981,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,25307,1982,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,25134,1983,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,25668,1984,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,26524,1985,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,27440,1986,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,28617,1987,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,29844,1988,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,30306,1989,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,31085,1990,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,31071,1991,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,31154,1992,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,31931,1993,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,33012,1994,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,34204,1995,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,34758,1996,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,35291,1997,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,35949,1998,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36390,1999,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36655,2000,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36765,2001,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36356,2002,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36332,2003,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36524,2004,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36356,2005,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,37325,2006,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,37375,2007,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,36501,2008,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,34963,2009,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,33964,2010,2013-10-07 20:19:14,2013-10-07 20:19:14
             19,34271,2011,2013-10-07 20:19:14,2013-10-07 20:19:14
         ', 2 => '
             1,1.5,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             2,2,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             3,0.5,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             4,0.75,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             5,1.43,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             6,0.7,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             7,1.3,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             8,1.18,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             9,1.04,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             10,0.5,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             11,0.26,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             12,0.59,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             13,1.07,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             14,0.8,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             15,0.44,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             16,0.51,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             17,1.12,NULL,2013-10-01 19:53:33,2013-10-01 19:53:33
             18,5451,1969,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,5805,1970,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,5415,1971,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6304,1972,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7040,1973,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6557,1974,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,5701,1975,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6669,1976,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7241,1977,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7800,1978,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7550,1979,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6569,1980,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6840,1981,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6447,1982,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,6926,1983,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7776,1984,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7707,1985,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7560,1986,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7979,1987,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8851,1988,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8876,1989,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8164,1990,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7924,1991,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7844,1992,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8221,1993,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8861,1994,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,9299,1995,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8894,1996,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,9125,1997,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10593,1998,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10895,1999,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10658,2000,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,9626,2001,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,9830,2002,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10097,2003,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10625,2004,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10445,2005,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10064,2006,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,10014,2007,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,9027,2008,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,7837,2009,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8375,2010,2013-10-07 20:19:09,2013-10-07 20:19:09
             18,8411,2011,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,2943,1969,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,2870,1970,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,2995,1971,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,3279,1972,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,3458,1973,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,3463,1974,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,3793,1975,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,3944,1976,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4087,1977,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4254,1978,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4369,1979,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4279,1980,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4421,1981,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4446,1982,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4508,1983,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4736,1984,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,4991,1985,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,5099,1986,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,5550,1987,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,5535,1988,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,5617,1989,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,5701,1990,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,5814,1991,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,6052,1992,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,6271,1993,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,6331,1994,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,7119,1995,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,7312,1996,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,7351,1997,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8141,1998,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8175,1999,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8442,2000,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8404,2001,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8440,2002,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8433,2003,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8803,2004,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8892,2005,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8990,2006,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,9232,2007,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8966,2008,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8810,2009,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8717,2010,2013-10-07 20:19:09,2013-10-07 20:19:09
             19,8931,2011,2013-10-07 20:19:09,2013-10-07 20:19:09
         '];
     foreach ($dbDump as $areaId => $dumpText) {
         $lines = explode("\n", $dumpText);
         foreach ($lines as $lineNum => $line) {
             $line = trim($line);
             if ($line == '') {
                 continue;
             }
             $fields = explode(',', $line);
             if ($fields[2] == 'NULL') {
                 $fields[2] = null;
             }
             $this->records[] = ['area_id' => $areaId, 'stat_category_id' => $fields[0], 'value' => $fields[1], 'year' => $fields[2], 'created' => $fields[3], 'modified' => $fields[4]];
         }
     }
     parent::init();
 }
Exemplo n.º 18
0
 public function init()
 {
     $this->records = [['id' => 1, 'user_id' => 1]];
     parent::init();
 }
Exemplo n.º 19
0
 public function init()
 {
     $this->records[] = ['id' => 1, 'user_id' => 1, 'membership_level_id' => 1, 'payment_id' => 1, 'auto_renew' => 1, 'created' => '2016-02-11 05:09:41', 'modified' => '2016-02-11 05:09:41', 'expires' => date('Y-m-d H:i:s', strtotime('+6 month')), 'canceled' => null];
     parent::init();
 }
 /**
  * method init
  * 
  * @return void
  */
 public function init()
 {
     $hasher = new DefaultPasswordHasher();
     $this->records = [['nom' => 'User', 'prenom' => 'First', 'fullname_slug' => 'first_user', 'email' => EMAIL_TO_TEST, 'password' => $hasher->hash('juVni4tr3'), 'role' => 'admin', 'actif' => true, 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'], ['nom' => 'User', 'prenom' => 'Second', 'fullname_slug' => 'second_user', 'email' => '*****@*****.**', 'password' => $hasher->hash('HuaB78lo'), 'actif' => true, 'change_pass_code' => '2400fd3226c673532e8e68d35c8c31115a83f6c3', 'change_pass_date' => '2014-02-04 09:30:21', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'], ['nom' => 'User', 'prenom' => 'Third', 'fullname_slug' => 'third_user', 'email' => '*****@*****.**', 'password' => $hasher->hash('Mak66uruck'), 'actif' => true, 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31']];
     parent::init();
 }