Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Jan 9, 2024
1 parent 2cffd08 commit 9712fb6
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 20 deletions.
3 changes: 2 additions & 1 deletion tests/Command/Migration/CreateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public function testExecute(): void
->with(
'testDatabase_foo',
$this->callback(static fn (string $name): bool => \str_contains($name, 'OrmTestDatabase')),
$this->callback(static fn (string $name): bool =>
$this->callback(
static fn (string $name): bool =>
\str_contains($name, 'OrmTestDatabase') &&
\str_contains($name, 'namespace Test\\Migration') &&
\str_contains($name, 'use Cycle\\Migrations\\Migration') &&
Expand Down
18 changes: 12 additions & 6 deletions tests/Command/Migration/GenerateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public function testExecuteWithOutstandingMigrations(): void
'databases' => ['default' => ['connection' => 'sqlite']],
'connections' => [
'sqlite' => new SQLiteDriverConfig(connection: new MemoryConnectionConfig()),
]
])), $repository);
],
])),
$repository
);
$migrator->configure();

$output = new FakeOutput();
Expand All @@ -67,8 +69,10 @@ public function testExecuteWithoutChanges(): void
'databases' => ['default' => ['connection' => 'sqlite']],
'connections' => [
'sqlite' => new SQLiteDriverConfig(connection: new MemoryConnectionConfig()),
]
])), $repository);
],
])),
$repository
);
$migrator->configure();

$output = new FakeOutput();
Expand Down Expand Up @@ -109,8 +113,10 @@ public function testExecute(): void
'databases' => ['default' => ['connection' => 'sqlite']],
'connections' => [
'sqlite' => new SQLiteDriverConfig(connection: new MemoryConnectionConfig()),
]
])), $repository);
],
])),
$repository
);
$migrator->configure();

$output = new FakeOutput();
Expand Down
6 changes: 4 additions & 2 deletions tests/Command/Migration/UpCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ public function testExecute(): void
'databases' => ['default' => ['connection' => 'sqlite']],
'connections' => [
'sqlite' => new SQLiteDriverConfig(connection: new MemoryConnectionConfig()),
]
])), $repository);
],
])),
$repository
);
$migrator->configure();

$output = new FakeOutput();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testEqualsHandler(): void
{
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))->withFilter((new Equals('id', 2)));
$reader = (new EntityReader($this->select('user')))->withFilter(new Equals('id', 2));

$this->assertEquals([(object)self::FIXTURES_USER[1]], $reader->read());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testGreaterThanHandler(): void
{
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))->withFilter((new GreaterThan('balance', 499)));
$reader = (new EntityReader($this->select('user')))->withFilter(new GreaterThan('balance', 499));

$this->assertEquals([(object)self::FIXTURES_USER[3]], $reader->read());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testGreaterThanOrEqualHandler(): void
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))
->withFilter((new GreaterThanOrEqual('balance', 500)));
->withFilter(new GreaterThanOrEqual('balance', 500));

$this->assertEquals([(object)self::FIXTURES_USER[3]], $reader->read());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Data/Reader/FilterHandler/InHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testInHandler(): void
{
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))->withFilter((new In('id', [2, 3])));
$reader = (new EntityReader($this->select('user')))->withFilter(new In('id', [2, 3]));

$this->assertEquals([(object)self::FIXTURES_USER[1], (object)self::FIXTURES_USER[2]], $reader->read());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testLessThanHandler(): void
{
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))->withFilter((new LessThan('balance', 1.1)));
$reader = (new EntityReader($this->select('user')))->withFilter(new LessThan('balance', 1.1));

$this->assertEquals([(object)self::FIXTURES_USER[1]], $reader->read());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testLessThanOrEqualHandler(): void
{
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))->withFilter((new LessThanOrEqual('balance', 1.0)));
$reader = (new EntityReader($this->select('user')))->withFilter(new LessThanOrEqual('balance', 1.0));

$this->assertEquals([(object)self::FIXTURES_USER[1]], $reader->read());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testLikeHandler(): void
{
$this->fillFixtures();

$reader = (new EntityReader($this->select('user')))->withFilter((new Like('email', 'seed@%')));
$reader = (new EntityReader($this->select('user')))->withFilter(new Like('email', 'seed@%'));

$this->assertEquals([(object)self::FIXTURES_USER[2]], $reader->read());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Factory/MigratorFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testInvoke(): void
$migrator = $factory(new SimpleContainer([
MigrationConfig::class => $defaultConfig,
DatabaseManager::class => $db,
FactoryInterface::class => $this->createMock(FactoryInterface::class)
FactoryInterface::class => $this->createMock(FactoryInterface::class),
]));

$configRef = new \ReflectionProperty($migrator, 'config');
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Factory/CycleDynamicFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CycleDynamicFactoryTest extends TestCase
public function testMake(): void
{
$factory = new CycleDynamicFactory(new Injector(new SimpleContainer([
ConnectionConfig::class => $this->createMock(ConnectionConfig::class)
ConnectionConfig::class => $this->createMock(ConnectionConfig::class),
])));

$this->assertInstanceOf(
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Factory/RepositoryContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp(): void
'foo' => [
Schema::ENTITY => FakeEntity::class,
Schema::REPOSITORY => FakeRepository::class,
]
],
]);
}

Expand All @@ -44,7 +44,7 @@ public function testGetNotFoundException(): void
public function testGetNotInstantiableClassException(): void
{
$container = new RepositoryContainer(new SimpleContainer([
ORMInterface::class => $this->createMock(ORMInterface::class)
ORMInterface::class => $this->createMock(ORMInterface::class),
]));

$this->expectException(NotInstantiableClassException::class);
Expand Down

0 comments on commit 9712fb6

Please sign in to comment.