This repository has been archived on 2025-05-12. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hack13-blog/tests/_support/Database/Seeds/ExampleSeeder.php
2020-07-27 22:22:06 -04:00

40 lines
926 B
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);
}
}
}