1 | <?php |
||
13 | class CreateDev extends Command |
||
14 | { |
||
15 | /** |
||
16 | * The name and signature of the console command. |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'myio:testenv'; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = 'Setup the testing environment'; |
||
27 | |||
28 | /** |
||
29 | * This testing environment file to write. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $envFile = '.env.testing'; |
||
34 | |||
35 | /** |
||
36 | * We will write our tests into this |
||
37 | * database file. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $dbFile = './database/database.sqlite'; |
||
42 | |||
43 | /** |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $defaults = []; |
||
47 | |||
48 | /** |
||
49 | * Create a new command instance. |
||
50 | */ |
||
51 | 12 | public function __construct() |
|
67 | |||
68 | /** |
||
69 | * Generate a unique APP key, This is |
||
70 | * code i stole and modified from the |
||
71 | * core. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 12 | private function createAppKey() |
|
79 | |||
80 | /** |
||
81 | * Create the sqlite file that we |
||
82 | * need for test database |
||
83 | * transactions. |
||
84 | * |
||
85 | * @return bool |
||
86 | */ |
||
87 | private function createDatabase() |
||
91 | |||
92 | /** |
||
93 | * Fil in the fields so we can write them |
||
94 | * to the .env.testing file. |
||
95 | */ |
||
96 | private function createEnvironment() |
||
111 | |||
112 | /** |
||
113 | * Handle the execution of the console |
||
114 | * command. |
||
115 | * |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function handle() |
||
150 | } |
||
151 |