SIGN IN SIGN UP
laravel / framework UNCLAIMED

Laravel is a web application framework with expressive, elegant syntax.

[9.x] Adds support for Parallel Testing (#35778) * Adds parallel testing * Fixes "Class MysqlBuilder" not found * Updates wording when drivers do not support create/drop databases * Avoids "getenv" and "putenv" in favour of $_SERVER * Moves "createDatabaseIfNotExists" to "createDatabase" * Adds support to "Postgres" * Fixes CS * Uses a database per process regardless of the used database testing trait * Apply fixes from StyleCI * Removes unused catch * Refactors into service providers * Apply fixes from StyleCI * Removes token resolver from the public API * Renames Parallel Testing register callbacks * Adds "setUp" process and "tearDown" test case * Updates Parallel Testing facade * Suffixes _test_ on storage too * Fixes missing envs for process callbacks * Apply fixes from StyleCI * Ensures "drops" only happen when needed * Apply fixes from StyleCI * Adds support for SQLite file databases * Adds tests for SQLite file databases * Lower case create/drop statements * Adds support for SQL Server * Apply fixes from StyleCI * Adds tests against Parallel Testing callbacks * Adds tests for parallel console output * Apply fixes from StyleCI * Removes unused lines in tests * Calls Parallel Testing setUp callbacks after refresh app only * Cleans folders for parallel testing * Makes test databases persist * Apply fixes from StyleCI * Resolve parallel testing callbacks from container * Apply fixes from StyleCI * Update TestDatabases.php * Update ParallelTesting.php * Renames "refresh-databases" to "recreate-databases" Co-authored-by: Nuno Maduro <nunomaduro@users.noreply.github.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
2021-01-13 15:20:19 +01:00
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Connection;
use Illuminate\Database\Schema\Grammars\Grammar;
use Mockery as m;
use PHPUnit\Framework\TestCase;
class DatabaseAbstractSchemaGrammarTest extends TestCase
{
public function testCreateDatabase()
{
$connection = m::mock(Connection::class);
2025-03-14 17:25:55 +00:00
$grammar = new class($connection) extends Grammar {
};
[9.x] Adds support for Parallel Testing (#35778) * Adds parallel testing * Fixes "Class MysqlBuilder" not found * Updates wording when drivers do not support create/drop databases * Avoids "getenv" and "putenv" in favour of $_SERVER * Moves "createDatabaseIfNotExists" to "createDatabase" * Adds support to "Postgres" * Fixes CS * Uses a database per process regardless of the used database testing trait * Apply fixes from StyleCI * Removes unused catch * Refactors into service providers * Apply fixes from StyleCI * Removes token resolver from the public API * Renames Parallel Testing register callbacks * Adds "setUp" process and "tearDown" test case * Updates Parallel Testing facade * Suffixes _test_ on storage too * Fixes missing envs for process callbacks * Apply fixes from StyleCI * Ensures "drops" only happen when needed * Apply fixes from StyleCI * Adds support for SQLite file databases * Adds tests for SQLite file databases * Lower case create/drop statements * Adds support for SQL Server * Apply fixes from StyleCI * Adds tests against Parallel Testing callbacks * Adds tests for parallel console output * Apply fixes from StyleCI * Removes unused lines in tests * Calls Parallel Testing setUp callbacks after refresh app only * Cleans folders for parallel testing * Makes test databases persist * Apply fixes from StyleCI * Resolve parallel testing callbacks from container * Apply fixes from StyleCI * Update TestDatabases.php * Update ParallelTesting.php * Renames "refresh-databases" to "recreate-databases" Co-authored-by: Nuno Maduro <nunomaduro@users.noreply.github.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
2021-01-13 15:20:19 +01:00
$this->assertSame('create database "foo"', $grammar->compileCreateDatabase('foo'));
[9.x] Adds support for Parallel Testing (#35778) * Adds parallel testing * Fixes "Class MysqlBuilder" not found * Updates wording when drivers do not support create/drop databases * Avoids "getenv" and "putenv" in favour of $_SERVER * Moves "createDatabaseIfNotExists" to "createDatabase" * Adds support to "Postgres" * Fixes CS * Uses a database per process regardless of the used database testing trait * Apply fixes from StyleCI * Removes unused catch * Refactors into service providers * Apply fixes from StyleCI * Removes token resolver from the public API * Renames Parallel Testing register callbacks * Adds "setUp" process and "tearDown" test case * Updates Parallel Testing facade * Suffixes _test_ on storage too * Fixes missing envs for process callbacks * Apply fixes from StyleCI * Ensures "drops" only happen when needed * Apply fixes from StyleCI * Adds support for SQLite file databases * Adds tests for SQLite file databases * Lower case create/drop statements * Adds support for SQL Server * Apply fixes from StyleCI * Adds tests against Parallel Testing callbacks * Adds tests for parallel console output * Apply fixes from StyleCI * Removes unused lines in tests * Calls Parallel Testing setUp callbacks after refresh app only * Cleans folders for parallel testing * Makes test databases persist * Apply fixes from StyleCI * Resolve parallel testing callbacks from container * Apply fixes from StyleCI * Update TestDatabases.php * Update ParallelTesting.php * Renames "refresh-databases" to "recreate-databases" Co-authored-by: Nuno Maduro <nunomaduro@users.noreply.github.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
2021-01-13 15:20:19 +01:00
}
public function testDropDatabaseIfExists()
{
$connection = m::mock(Connection::class);
2025-03-14 17:25:55 +00:00
$grammar = new class($connection) extends Grammar {
};
[9.x] Adds support for Parallel Testing (#35778) * Adds parallel testing * Fixes "Class MysqlBuilder" not found * Updates wording when drivers do not support create/drop databases * Avoids "getenv" and "putenv" in favour of $_SERVER * Moves "createDatabaseIfNotExists" to "createDatabase" * Adds support to "Postgres" * Fixes CS * Uses a database per process regardless of the used database testing trait * Apply fixes from StyleCI * Removes unused catch * Refactors into service providers * Apply fixes from StyleCI * Removes token resolver from the public API * Renames Parallel Testing register callbacks * Adds "setUp" process and "tearDown" test case * Updates Parallel Testing facade * Suffixes _test_ on storage too * Fixes missing envs for process callbacks * Apply fixes from StyleCI * Ensures "drops" only happen when needed * Apply fixes from StyleCI * Adds support for SQLite file databases * Adds tests for SQLite file databases * Lower case create/drop statements * Adds support for SQL Server * Apply fixes from StyleCI * Adds tests against Parallel Testing callbacks * Adds tests for parallel console output * Apply fixes from StyleCI * Removes unused lines in tests * Calls Parallel Testing setUp callbacks after refresh app only * Cleans folders for parallel testing * Makes test databases persist * Apply fixes from StyleCI * Resolve parallel testing callbacks from container * Apply fixes from StyleCI * Update TestDatabases.php * Update ParallelTesting.php * Renames "refresh-databases" to "recreate-databases" Co-authored-by: Nuno Maduro <nunomaduro@users.noreply.github.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
2021-01-13 15:20:19 +01:00
$this->assertSame('drop database if exists "foo"', $grammar->compileDropDatabaseIfExists('foo'));
[9.x] Adds support for Parallel Testing (#35778) * Adds parallel testing * Fixes "Class MysqlBuilder" not found * Updates wording when drivers do not support create/drop databases * Avoids "getenv" and "putenv" in favour of $_SERVER * Moves "createDatabaseIfNotExists" to "createDatabase" * Adds support to "Postgres" * Fixes CS * Uses a database per process regardless of the used database testing trait * Apply fixes from StyleCI * Removes unused catch * Refactors into service providers * Apply fixes from StyleCI * Removes token resolver from the public API * Renames Parallel Testing register callbacks * Adds "setUp" process and "tearDown" test case * Updates Parallel Testing facade * Suffixes _test_ on storage too * Fixes missing envs for process callbacks * Apply fixes from StyleCI * Ensures "drops" only happen when needed * Apply fixes from StyleCI * Adds support for SQLite file databases * Adds tests for SQLite file databases * Lower case create/drop statements * Adds support for SQL Server * Apply fixes from StyleCI * Adds tests against Parallel Testing callbacks * Adds tests for parallel console output * Apply fixes from StyleCI * Removes unused lines in tests * Calls Parallel Testing setUp callbacks after refresh app only * Cleans folders for parallel testing * Makes test databases persist * Apply fixes from StyleCI * Resolve parallel testing callbacks from container * Apply fixes from StyleCI * Update TestDatabases.php * Update ParallelTesting.php * Renames "refresh-databases" to "recreate-databases" Co-authored-by: Nuno Maduro <nunomaduro@users.noreply.github.com> Co-authored-by: Taylor Otwell <taylor@laravel.com>
2021-01-13 15:20:19 +01:00
}
}