Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/Migrations/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ public function getDriver(): Driver
return static::$driverCache[static::DRIVER] = $this->driver;
}

/**
* @param string $directory
* @return AbstractTable[]
*/
protected function migrate(string $directory): array
{
$tokenizer = new Tokenizer(new TokenizerConfig([
Expand Down
17 changes: 17 additions & 0 deletions tests/Migrations/Fixtures/Alter/PrimaryToBigint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Cycle\Migrations\Tests\Fixtures\Alter;

/**
* @Entity
*/
class PrimaryToBigint
{
/**
* @Column(type=bigint, primary=true)
* @var int
*/
protected $id;
}
17 changes: 17 additions & 0 deletions tests/Migrations/Fixtures/Init/PrimaryToBigint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Cycle\Migrations\Tests\Fixtures\Init;

/**
* @Entity
*/
class PrimaryToBigint
{
/**
* @Column(type=primary)
* @var int
*/
protected $id;
}
3 changes: 3 additions & 0 deletions tests/Migrations/ReflectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public function testNoChanges(): void
$this->assertCount(2, $this->migrator->getMigrations());
}

/**
* @throws \Throwable
*/
public function testAlter(): void
{
$tables = $this->migrate(__DIR__ . '/Fixtures/Init');
Expand Down