Skip to content

Commit

Permalink
Fix Schema::getTableNames()
Browse files Browse the repository at this point in the history
Co-authored-by: Asmir Mustafic <goetas@gmail.com>
  • Loading branch information
morozov and goetas committed Sep 22, 2021
1 parent 3ee2622 commit e343550
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Schema/SqliteSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,4 +568,13 @@ public function listTableDetails($name): Table

return $table;
}

/**
* {@inheritDoc}
*/
public function getSchemaSearchPaths()
{
// SQLite does not support schemas or databases
return [];
}
}
20 changes: 20 additions & 0 deletions tests/Functional/Schema/SchemaTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Tests\Functional\Schema;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Tests\FunctionalTestCase;

class SchemaTest extends FunctionalTestCase
{
public function testGetTableNames(): void
{
$schema = new Schema([], [], $this->connection->createSchemaManager()->createSchemaConfig());
$schema->createTable('foo');

$tableNames = $schema->getTableNames();
self::assertEquals(['public.foo'], $tableNames);
}
}

0 comments on commit e343550

Please sign in to comment.