2018-01-16 21:26:59 +01:00
|
|
|
<?php
|
|
|
|
|
2020-04-19 20:41:38 +02:00
|
|
|
namespace Engelsystem\Test\Unit\Database\Migration;
|
2018-01-16 21:26:59 +01:00
|
|
|
|
2018-10-24 13:35:31 +02:00
|
|
|
use Engelsystem\Migrations\AnotherStuff;
|
2018-01-16 21:26:59 +01:00
|
|
|
use Illuminate\Database\Schema\Builder as SchemaBuilder;
|
|
|
|
use PHPUnit\Framework\MockObject\MockBuilder;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
class MigrationTest extends TestCase
|
|
|
|
{
|
2020-01-02 15:08:08 +01:00
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Database\Migration\Migration::__construct
|
|
|
|
*/
|
2018-01-16 21:26:59 +01:00
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
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);
|
2019-04-24 10:45:00 +02:00
|
|
|
$this->assertEquals($schemaBuilder, $instance->getSchema());
|
2018-01-16 21:26:59 +01:00
|
|
|
}
|
|
|
|
}
|