Skip to content

Commit

Permalink
bc
Browse files Browse the repository at this point in the history
  • Loading branch information
chu121su12 committed Sep 14, 2021
1 parent 7eb4545 commit 0a1d4b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 deletions.
30 changes: 0 additions & 30 deletions tests/Database/DatabaseSchemaBlueprintIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,36 +77,6 @@ public function testRenamingAndChangingColumnsWork()
$this->assertEquals($expected, $queries);
}

// public function testRenamingAndChangingColumnsWork()
// {
// $this->db->connection()->getSchemaBuilder()->create('users', function ($table) {
// $table->string('name');
// $table->string('age');
// });

// $blueprint = new Blueprint('users', function ($table) {
// $table->renameColumn('name', 'first_name');
// $table->integer('age')->change();
// });

// $queries = $blueprint->toSql($this->db->connection(), new SQLiteGrammar);

// $expected = [
// 'CREATE TEMPORARY TABLE __temp__users AS SELECT name, age FROM users',
// 'DROP TABLE users',
// 'CREATE TABLE users (name VARCHAR(255) NOT NULL COLLATE BINARY, age INTEGER NOT NULL)',
// 'INSERT INTO users (name, age) SELECT name, age FROM __temp__users',
// 'DROP TABLE __temp__users',
// 'CREATE TEMPORARY TABLE __temp__users AS SELECT name, age FROM users',
// 'DROP TABLE users',
// 'CREATE TABLE users (age VARCHAR(255) NOT NULL COLLATE BINARY, first_name VARCHAR(255) NOT NULL)',
// 'INSERT INTO users (first_name, age) SELECT name, age FROM __temp__users',
// 'DROP TABLE __temp__users',
// ];

// $this->assertEquals($expected, $queries);
// }

public function testChangingColumnWithCollationWorks()
{
$this->db->connection()->getSchemaBuilder()->create('users', function ($table) {
Expand Down
16 changes: 9 additions & 7 deletions tests/Log/LogManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
use ReflectionProperty;
use RuntimeException;

class LogManagerTest_testItUtilisesTheNullDriverDuringTestsWhenNullDriverUsed_class extends LogManager
{
protected function createEmergencyLogger()
{
throw new RuntimeException('Emergency logger was created.');
}
}

class LogManagerTest extends TestCase
{
public function testLogManagerCachesLoggerInstances()
Expand Down Expand Up @@ -212,13 +220,7 @@ public function testItUtilisesTheNullDriverDuringTestsWhenNullDriverUsed()
'driver' => 'monolog',
'handler' => NullHandler::class,
]);
$manager = new class($this->app) extends LogManager
{
protected function createEmergencyLogger()
{
throw new RuntimeException('Emergency logger was created.');
}
};
$manager = new LogManagerTest_testItUtilisesTheNullDriverDuringTestsWhenNullDriverUsed_class($this->app);

// In tests, this should not need to create the emergency logger...
$manager->info('message');
Expand Down

0 comments on commit 0a1d4b2

Please sign in to comment.