1 | <?php |
||
5 | class CreateMetaCommandTest extends AbstractTestCase |
||
6 | { |
||
7 | public function testTableCreation() |
||
8 | { |
||
9 | $this->assertTrue(\Schema::hasTable('meta')); |
||
10 | |||
11 | $this->assertEquals([ |
||
12 | 'id', |
||
13 | 'key', |
||
14 | 'tag', |
||
15 | 'model_id', |
||
16 | 'model_type', |
||
17 | 'type', |
||
18 | 'value', |
||
19 | 'created_at', |
||
20 | 'updated_at', |
||
21 | ], \Schema::getColumnListing('meta')); |
||
22 | } |
||
23 | |||
24 | public function testCustomModelName() |
||
25 | { |
||
26 | static::makeMigration(['model_name' => 'test']); |
||
27 | |||
28 | $this->assertTrue(\Schema::hasTable('test_meta')); |
||
29 | } |
||
30 | |||
31 | public function testCustomPath() |
||
32 | { |
||
33 | static::makeMigration(['--path' => 'storage']); |
||
34 | |||
35 | $migration = head(glob($this->app->storagePath().'/*migration.php')); |
||
36 | |||
37 | $this->assertFileExists($migration); |
||
38 | } |
||
39 | } |
||
40 |