Skip to content

Commit 5dc8590

Browse files
committed
Rewrite/simplify tests
Use the Validator face instead of making POST requests to trigger validation.
1 parent 6d7444b commit 5dc8590

File tree

3 files changed

+271
-276
lines changed

3 files changed

+271
-276
lines changed

tests/TestCase.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace CodeZero\UniqueTranslation\Tests;
44

5+
use App;
56
use CodeZero\UniqueTranslation\UniqueTranslationServiceProvider;
7+
use Config;
68
use Illuminate\Database\Schema\Blueprint;
79
use Orchestra\Testbench\TestCase as BaseTestCase;
8-
use Route;
910

1011
abstract class TestCase extends BaseTestCase
1112
{
@@ -16,6 +17,13 @@ abstract class TestCase extends BaseTestCase
1617
*/
1718
protected $table = 'test_models';
1819

20+
/**
21+
* Name of the validation rule.
22+
*
23+
* @var string
24+
*/
25+
protected $rule = 'unique_translation';
26+
1927
/**
2028
* Setup the test environment.
2129
*
@@ -25,7 +33,9 @@ public function setUp()
2533
{
2634
parent::setUp();
2735

28-
config()->set('app.key', str_random(32));
36+
Config::set('app.key', str_random(32));
37+
38+
App::setLocale('en');
2939

3040
$this->setupDatabase();
3141
}

0 commit comments

Comments
 (0)