boot(); $this->migrate(); $connection = new DbalConnection($this->dbal()); self::assertSame('sqlite', $connection->dialect()); self::assertSame(PaymentsSchema::SCHEMA_VERSION, (new SqlPaymentRepository($connection))->meta()->storedSchemaVersion()); } public function testDoctrineSchemaToolsNeverSeeTheEngineTables(): void { $this->boot(); $this->migrate(); $this->dbal()->executeStatement('CREATE TABLE orders (id TEXT PRIMARY KEY)'); $filter = $this->dbal()->getConfiguration()->getSchemaAssetsFilter(); self::assertNotNull($filter); self::assertFalse($filter('openreceive_payments')); self::assertFalse($filter('openreceive_meta')); self::assertTrue($filter('orders')); $tables = $this->dbal()->createSchemaManager()->introspectSchema()->getTables(); $names = array_map(static fn ($table): string => strtolower($table->getName()), $tables); self::assertSame(['orders'], array_values($names), 'a migrations diff must never propose dropping the engine tables'); } public function testTheFilterIgnoresASchemaQualifier(): void { $filter = new SchemaFilter(['openreceive_payments']); self::assertFalse($filter('public.openreceive_payments')); self::assertTrue($filter('public.orders')); } public function testIntegersBindAsIntegers(): void { $this->boot(); $connection = new DbalConnection($this->dbal()); self::assertSame([['n' => 2]], array_map(static fn (array $row): array => ['n' => (int) $row['n']], $connection->query('SELECT 1 + ? AS n', [1]))); self::assertSame(1, $connection->transaction(static fn (DbalConnection $c): int => $c->execute('CREATE TABLE t (x INTEGER)') + 1)); } }