Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
ArlonAntonius authored and StyleCIBot committed Nov 7, 2020
1 parent d87338a commit 52fe82d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/Generators/Webserver/Database/Drivers/PostgreSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ protected function dropDatabase(IlluminateConnection $connection, array $config)

protected function dropUser(IlluminateConnection $connection, array $config)
{
if (config('tenancy.db.auto-delete-tenant-database-user') && $this->userExists($connection,
$config['username'])) {
if (config('tenancy.db.auto-delete-tenant-database-user') && $this->userExists(
$connection,
$config['username']
)) {
return $connection->statement("DROP USER \"{$config['username']}\"");
}

Expand Down
3 changes: 2 additions & 1 deletion src/Website/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public function path(string $path = null, $local = false): string
}

if ($local && $this->isLocal()) {
$path = sprintf("%s%s",
$path = sprintf(
"%s%s",
$this->filesystem->getAdapter()->getPathPrefix(),
$path
);
Expand Down
4 changes: 3 additions & 1 deletion tests/traits/InteractsWithRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ protected function create_and_test_route(string $path, string $uri = null)
}

// Write a testing config.
$this->assertTrue($directory->put('routes.php', <<<EOM
$this->assertTrue($directory->put(
'routes.php',
<<<EOM
<?php
\Route::get('$path', function () { return 'testing'; })->name('bar');
Expand Down
14 changes: 10 additions & 4 deletions tests/unit-tests/Filesystem/LoadsConfigsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ public function reads_additional_config()
$this->assertTrue($this->directory->makeDirectory('config'));

// Write a testing config.
$this->assertTrue($this->directory->put('config/test.php', <<<EOM
$this->assertTrue($this->directory->put(
'config/test.php',
<<<EOM
<?php
return ['foo' => 'bar'];
EOM
));
));

$this->assertTrue($this->directory->exists('config/test.php'));

Expand All @@ -70,7 +72,9 @@ public function does_not_make_config_array()
$this->assertTrue($this->directory->makeDirectory('config'));

// Write a testing config.
$this->assertTrue($this->directory->put('config/app.php', <<<EOM
$this->assertTrue($this->directory->put(
'config/app.php',
<<<EOM
<?php
return ['name' => 'bar'];
Expand All @@ -93,7 +97,9 @@ public function blocks_blacklisted_configs()
$this->assertTrue($this->directory->makeDirectory('config'));

// Write a testing config.
$this->assertTrue($this->directory->put('config/database.php', <<<EOM
$this->assertTrue($this->directory->put(
'config/database.php',
<<<EOM
<?php
return ['foo' => 'bar'];
Expand Down
10 changes: 7 additions & 3 deletions tests/unit-tests/Filesystem/LoadsTranslationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ public function reads_additional_translations()
$this->assertTrue($this->directory->makeDirectory('lang'));

// Write a testing translation file.
$this->assertTrue($this->directory->put('lang/ch/test.php', <<<EOM
$this->assertTrue($this->directory->put(
'lang/ch/test.php',
<<<EOM
<?php
return [
'foo' => 'bar'
];
EOM
));
));

$this->assertTrue($this->directory->exists('lang/ch/test.php'));

Expand Down Expand Up @@ -99,7 +101,9 @@ protected function saveAndConfirmTenantTranslation()
$this->assertTrue($this->directory->makeDirectory('lang'));

// Write a testing translation file.
$this->assertTrue($this->directory->put('lang/en/passwords.php', <<<EOM
$this->assertTrue($this->directory->put(
'lang/en/passwords.php',
<<<EOM
<?php
return [
Expand Down
6 changes: 4 additions & 2 deletions tests/unit-tests/Filesystem/LoadsVendorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ public function reads_additional_vendor()
$this->assertTrue($this->directory->makeDirectory('vendor'));

// Write a testing config.
$this->assertTrue($this->directory->put('vendor/autoload.php', <<<EOM
$this->assertTrue($this->directory->put(
'vendor/autoload.php',
<<<EOM
<?php
namespace Test\Vendor;
class Foo {}
EOM
));
));

$this->assertTrue($this->directory->exists('vendor/autoload.php'));

Expand Down
4 changes: 3 additions & 1 deletion tests/unit-tests/Providers/RouteProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class RouteProviderTest extends Test
{
protected function pathIdentified(string $path)
{
file_put_contents("$path/routes/tenants.php", <<<EOM
file_put_contents(
"$path/routes/tenants.php",
<<<EOM
<?php
\Route::get('/', function () { return 'bar'; })->name('tenant');
Expand Down

0 comments on commit 52fe82d

Please sign in to comment.