Conditions | 3 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
10 | protected function _execute(array $options) |
||
11 | { |
||
12 | $db = $this->db_params(Kohana::TESTING); |
||
13 | |||
14 | Minion_Task::factory(array( |
||
15 | 'task' => 'db:structure:load', |
||
16 | 'database' => Kohana::TESTING, |
||
17 | 'force' => NULL, |
||
18 | 'file' => NULL, |
||
19 | )) |
||
20 | ->execute(); |
||
21 | |||
22 | $structure_files = array_filter(array_map(function($dir) use ($db) { |
||
23 | $file = $dir.'tests'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'structure'.DIRECTORY_SEPARATOR.strtolower($db['type']).'.sql'; |
||
24 | return is_file($file) ? $file : NULL; |
||
25 | }, Kohana::modules())); |
||
26 | |||
27 | foreach ($structure_files as $schema) |
||
28 | { |
||
29 | Minion_Task::factory(array( |
||
30 | 'task' => 'db:structure:load', |
||
31 | 'database' => Kohana::TESTING, |
||
32 | 'force' => NULL, |
||
33 | 'file' => $schema, |
||
34 | )) |
||
35 | ->execute(); |
||
36 | } |
||
37 | } |
||
38 | } |
||
39 |