summaryrefslogtreecommitdiff
path: root/tests/Unit/Database/Migration/MigrationTest.php
blob: 953ffe2ec7defd539dcad76741b8ac0f7c9e262d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace Engelsystem\Test\Unit\Database;

use Engelsystem\Migrations\AnotherStuff;
use Illuminate\Database\Schema\Builder as SchemaBuilder;
use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\TestCase;

class MigrationTest extends TestCase
{
    /**
     * @covers \Engelsystem\Database\Migration\Migration::__construct
     */
    public function testConstructor()
    {
        require_once __DIR__ . '/Stub/2017_12_24_053300_another_stuff.php';

        /** @var MockBuilder|SchemaBuilder $schemaBuilder */
        $schemaBuilder = $this->getMockBuilder(SchemaBuilder::class)
            ->disableOriginalConstructor()
            ->getMock();

        $instance = new AnotherStuff($schemaBuilder);
        $this->assertEquals($schemaBuilder, $instance->getSchema());
    }
}