Skip to content

Commit

Permalink
Merge pull request #2 from madeITBelgium/analysis-qMpB2l
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
madeITBelgium committed Jun 19, 2017
2 parents be33325 + 7dae6e6 commit 47891de
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/EmailDomainServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ protected function extendValidator($rule)
{
$method = 'validate'.studly_case($rule);
$translation = $this->app['translator']->get('emaildomain::validation');
$this->app['validator']->extend($rule, 'MadeITBelgium\EmailDomainValidation\Validation\ValidatorExtensions@' . $method, $translation[$rule]);
$this->app['validator']->extend($rule, 'MadeITBelgium\EmailDomainValidation\Validation\ValidatorExtensions@'.$method, $translation[$rule]);
}
}
29 changes: 15 additions & 14 deletions src/lang/en/validation.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| our custom validator class. Some of these rules have multiple versions such
| such as the size rules. Feel free to tweak each of these messages.
|
*/
'domain' => "The domain of :attribute is not allowed.",
'domainnot' => "The domain of :attribute is not allowed."
);

return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| our custom validator class. Some of these rules have multiple versions such
| such as the size rules. Feel free to tweak each of these messages.
|
*/
'domain' => 'The domain of :attribute is not allowed.',
'domainnot' => 'The domain of :attribute is not allowed.',
];
5 changes: 2 additions & 3 deletions tests/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function testValidatorNotInDomain()
$this->assertTrue($validator->isEmailNotAllowed('info@madeit.be', ['example.be']));
}


public function testValidEmail()
{
$validator = Mockery::mock('MadeITBelgium\EmailDomainValidation\Validation\Validator');
Expand All @@ -37,7 +36,7 @@ public function testValidEmail()
$validator = $factory->make(['foo' => 'info@madeit.be'], ['foo' => 'domain:madeit.be']);
$this->assertTrue($validator->passes());
}

public function testValidEmailFails()
{
$validator = Mockery::mock('MadeITBelgium\EmailDomainValidation\Validation\Validator');
Expand Down Expand Up @@ -72,7 +71,7 @@ public function testValidEmailNotAllowed()
$validator = $factory->make(['foo' => 'info@madeit.be'], ['foo' => 'domainnot:tpweb.org']);
$this->assertTrue($validator->passes());
}

public function testValidEmailNotAllowedFails()
{
$validator = Mockery::mock('MadeITBelgium\EmailDomainValidation\Validation\Validator');
Expand Down

0 comments on commit 47891de

Please sign in to comment.