castopod/tests/_support/Database/Seeds/ExampleSeeder.php
Yassine Doghri ed6e953010 refactor: add php_codesniffer to define castopod's coding style based on psr-1
- add .editorconfig file
- format all files to comply with castopod's coding style
- switch parsedown dependency with commonmark library to better follow commonmark spec for markdown
- add prettier command to format all project files at once

closes #16
2020-10-15 14:41:22 +00:00

40 lines
1.1 KiB
PHP

<?php namespace Tests\Support\Database\Seeds;
use CodeIgniter\Database\Seeder;
class ExampleSeeder extends Seeder
{
public function run()
{
$factories = [
[
'name' => 'Test Factory',
'uid' => 'test001',
'class' => 'Factories\Tests\NewFactory',
'icon' => 'fas fa-puzzle-piece',
'summary' => 'Longer sample text for testing',
],
[
'name' => 'Widget Factory',
'uid' => 'widget',
'class' => 'Factories\Tests\WidgetPlant',
'icon' => 'fas fa-puzzle-piece',
'summary' => 'Create widgets in your factory',
],
[
'name' => 'Evil Factory',
'uid' => 'evil-maker',
'class' => 'Factories\Evil\MyFactory',
'icon' => 'fas fa-book-dead',
'summary' => 'Abandon all hope, ye who enter here',
],
];
$builder = $this->db->table('factories');
foreach ($factories as $factory) {
$builder->insert($factory);
}
}
}