-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
202 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class ActionMakeTest extends TestCase | ||
{ | ||
public function test_an_action_make_command_creates_action(): void | ||
{ | ||
$this->artisan('root:action', ['name' => 'TestAction']) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Actions/TestAction.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Actions/TestAction.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Http\UploadedFile; | ||
use Illuminate\Support\Facades\Storage; | ||
|
||
class CommandsTest extends TestCase | ||
{ | ||
public function test_a_command_can_clear_chunks(): void | ||
{ | ||
Storage::disk('local')->putFileAs( | ||
'', | ||
UploadedFile::fake()->create('test.chunk'), | ||
'root-tmp/test.chunk' | ||
); | ||
|
||
$this->artisan('root:clear-chunks') | ||
->expectsOutput('1 chunks are cleared!') | ||
->assertExitCode(Command::SUCCESS); | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class FieldMakeTest extends TestCase | ||
{ | ||
public function test_a_field_make_command_creates_field(): void | ||
{ | ||
$this->artisan('root:field', [ | ||
'name' => 'TestField', | ||
'--template' => 'foo', | ||
]) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Fields/TestField.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Fields/TestField.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class FilterMakeTest extends TestCase | ||
{ | ||
public function test_a_filter_make_command_creates_filter(): void | ||
{ | ||
$this->artisan('root:filter', [ | ||
'name' => 'TestFilter', | ||
'--type' => 'select', | ||
'--multiple' => true, | ||
]) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Filters/TestFilter.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Filters/TestFilter.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class ResourceMakeTest extends TestCase | ||
{ | ||
public function test_a_resource_make_command_creates_resource(): void | ||
{ | ||
$this->artisan('root:resource', ['name' => 'TestResource']) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Resources/TestResource.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Resources/TestResource.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class TrendMakeTest extends TestCase | ||
{ | ||
public function test_a_trend_make_command_creates_trend_widget(): void | ||
{ | ||
$this->artisan('root:trend', ['name' => 'TrendWidget']) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Widgets/TrendWidget.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Widgets/TrendWidget.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class ValueMakeTest extends TestCase | ||
{ | ||
public function test_a_value_make_command_creates_value_widget(): void | ||
{ | ||
$this->artisan('root:value', ['name' => 'ValueWidget']) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Widgets/ValueWidget.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Widgets/ValueWidget.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Console; | ||
|
||
use Cone\Root\Tests\TestCase; | ||
use Illuminate\Console\Command; | ||
|
||
class WidgetMakeTest extends TestCase | ||
{ | ||
public function test_a_widget_make_command_creates_widget(): void | ||
{ | ||
$this->artisan('root:widget', ['name' => 'TestWidget']) | ||
->assertExitCode(Command::SUCCESS); | ||
|
||
$this->assertFileExists($this->app->path('/Root/Widgets/TestWidget.php')); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
unlink($this->app->path('/Root/Widgets/TestWidget.php')); | ||
|
||
parent::tearDown(); | ||
} | ||
} |
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