Completed
Push — master ( 662b17...55cf61 )
by Oliver
10:02
created

CreateMetaCommandTest::testCustomModelName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace BoxedCode\Tests\Eloquent\Meta;
4
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