Make it easier to test by adding IncidentSeeder

This commit is contained in:
James Brooks
2014-11-19 11:57:50 +00:00
parent ad7e1b7439
commit 68ddefff1f
2 changed files with 43 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ class DatabaseSeeder extends Seeder {
Eloquent::unguard();
$this->call('SettingsTableSeeder');
$this->call('IncidentTableSeeder');
}
}

View File

@@ -0,0 +1,42 @@
<?php
class IncidentTableSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$defaultIncidents = [
[
"name" => "Test Incident",
"message" => "Something went wrong, oh noes."
],
[
"name" => "Update",
"message" => "We've found the problem, so we're looking at it.",
"status" => 2
],
[
"name" => "Monitoring the fix",
"message" => "We're checking that our fix will first work.",
"status" => 3
],
[
"name" => "Awesome",
"message" => "We totally nailed the fix.",
"status" => 4
]
];
Incident::truncate();
foreach($defaultIncidents as $incident) {
Incident::create($incident);
}
}
}