-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix publish views location * Add tests
- Loading branch information
Showing
14 changed files
with
101 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace GeoSot\EnvEditor\Tests\Feature; | ||
|
||
|
||
use GeoSot\EnvEditor\Facades\EnvEditor; | ||
use GeoSot\EnvEditor\Tests\TestCase; | ||
use Illuminate\Config\Repository; | ||
use Illuminate\Filesystem\Filesystem; | ||
|
||
class UiTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function can_see_dashboard(): void | ||
{ | ||
$response = $this->get($this->makeRoute('index')); | ||
$response->assertStatus(200) | ||
->assertSee(trans('env-editor::env-editor.menuTitle')); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function can_see_backups(): void | ||
{ | ||
$response = $this->get($this->makeRoute('getBackups')); | ||
$response->assertStatus(200) | ||
->assertSee(trans('env-editor::env-editor.views.backup.title')); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function can_download(): void | ||
{ | ||
EnvEditor::shouldReceive('getFilePath')->once()->with('fooBar')->andReturns(self::getTestFile(true)); | ||
$response = $this->get($this->makeRoute('download', ['filename' => 'fooBar'])); | ||
$response->assertStatus(200); | ||
$response->assertDownload(self::getTestFile()); | ||
} | ||
|
||
|
||
/** | ||
* @param string $route | ||
* @param array<string, string> $parameters | ||
* @return string | ||
*/ | ||
protected function makeRoute(string $route, array $parameters = []): string | ||
{ | ||
return route(config('env-editor.route.name').'.'.$route, $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
APP_NAME="Test env" | ||
APP_ENV=local | ||
APP_URL=https://example.test | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
|
||
|
||
BROADCAST_DRIVER= | ||
CACHE_DRIVER="file" | ||
FILESYSTEM_DRIVER=local |