Skip to content

Commit

Permalink
Tweak travis setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
jumilla committed Dec 6, 2016
1 parent 846461f commit a22e9e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 5.6
- 7.0
- 7.1
- hhvm

before_script:
Expand Down
3 changes: 0 additions & 3 deletions tests/ServiceProviderTests.php
Expand Up @@ -8,15 +8,12 @@ class ServiceProviderTests extends TestCase
public function test_withNoParameter()
{
$app = $this->createApplication();
$app['events'] = $this->createMock('event');
$blade = $this->createMock('alias:'.Blade::class);
$blade->shouldReceive('extend')->atLeast()->times(1);

$app['config']->set('app.aliases', []);

$command = new ServiceProvider($app);
$app['events']->shouldReceive('listen')->once();

$command->register();
$command->boot();
}
Expand Down
12 changes: 7 additions & 5 deletions tests/Specs/SpecsInputModelTests.php
Expand Up @@ -3,8 +3,8 @@
use LaravelPlus\Extension\Specs\InputModel;
use LaravelPlus\Extension\Specs\InputSpec;
use LaravelPlus\Extension\Repository\NamespacedRepository;
use Symfony\Component\Translation\TranslatorInterface;
use Illuminate\Http\Request;
use Illuminate\Translation\Translator;
use Illuminate\Validation\Factory as ValidatorFactory;
use Illuminate\Validation\Validator;

Expand All @@ -14,14 +14,15 @@ public function test_makeMethod()
{
$app = $this->createApplication();
$app['specs'] = $spec = $this->createMock(NamespacedRepository::class);
$app['translator'] = $translator = $this->createMock(TranslatorInterface::class);
$app['translator'] = $translator = $this->createMock(Translator::class);
$app['validator'] = new ValidatorFactory($translator, $app);
$app['request'] = $request = new Request();

$spec->shouldReceive('get')->with('foo')->andReturn([])->once();
$translator->shouldReceive('has')->with('foo')->andReturn(true)->once();
$translator->shouldReceive('get')->with('foo.rules')->andReturn([])->once();
$translator->shouldReceive('get')->with('foo.attributes')->andReturn([])->once();
$translator->shouldReceive('get')->andReturn('bar');

$inputModel = InputModel::make('foo', []);

Expand All @@ -32,7 +33,7 @@ public function test_gatherInputMethod_andPassesMethod()
{
$app = $this->createApplication();
$spec = $this->createMock(InputSpec::class);
$app['translator'] = $translator = $this->createMock(TranslatorInterface::class);
$app['translator'] = $translator = $this->createMock(Translator::class);
$app['validator'] = new ValidatorFactory($translator, $app);
$app['request'] = $request = $this->createMock(Request::class);

Expand All @@ -51,13 +52,14 @@ public function test_failsMethod()
{
$app = $this->createApplication();
$spec = $this->createMock(InputSpec::class);
$app['translator'] = $translator = $this->createMock(TranslatorInterface::class);
$app['translator'] = $translator = $this->createMock(Translator::class);
$app['validator'] = $validator = new ValidatorFactory($translator, $app);

$spec->shouldReceive('rules')->andReturn(['qux' => 'required'])->once();
$spec->shouldReceive('ruleMessages')->andReturn([])->once();
$spec->shouldReceive('labels')->andReturn([])->once();
$translator->shouldReceive('trans')->andReturn('failed');
$translator->shouldReceive('get')->andReturn('failed')->once();

$inputModel = new InputModel($spec, ['qux' => '']);

Expand All @@ -69,7 +71,7 @@ public function test_otherMethods()
{
$app = $this->createApplication();
$spec = $this->createMock(InputSpec::class);
$app['translator'] = $translator = $this->createMock(TranslatorInterface::class);
$app['translator'] = $translator = $this->createMock(Translator::class);
$app['validator'] = $validator = new ValidatorFactory($translator, $app);

$spec->shouldReceive('rules')->andReturn(['qux' => 'required'])->once();
Expand Down

0 comments on commit a22e9e3

Please sign in to comment.