Skip to content

Commit

Permalink
rename validate resolved method to avoid conflicts with macro
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 10, 2018
1 parent ce88b25 commit 33d8642
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ interface ValidatesWhenResolved
*
* @return void
*/
public function validate();
public function validateResolved();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function register()
public function boot()
{
$this->app->afterResolving(ValidatesWhenResolved::class, function ($resolved) {
$resolved->validate();
$resolved->validateResolved();
});

$this->app->resolving(FormRequest::class, function ($request, $app) {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/ValidatesWhenResolvedTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait ValidatesWhenResolvedTrait
*
* @return void
*/
public function validate()
public function validateResolved()
{
$this->prepareForValidation();

Expand Down
8 changes: 4 additions & 4 deletions tests/Foundation/FoundationFormRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function test_validated_method_returns_the_validated_data()
{
$request = $this->createRequest(['name' => 'specified', 'with' => 'extras']);

$request->validate();
$request->validateResolved();

$this->assertEquals(['name' => 'specified'], $request->validated());
}
Expand All @@ -43,7 +43,7 @@ public function test_validate_throws_when_validation_fails()

$this->mocks['redirect']->shouldReceive('withInput->withErrors');

$request->validate();
$request->validateResolved();
}

/**
Expand All @@ -52,12 +52,12 @@ public function test_validate_throws_when_validation_fails()
*/
public function test_validate_method_throws_when_authorization_fails()
{
$this->createRequest([], FoundationTestFormRequestForbiddenStub::class)->validate();
$this->createRequest([], FoundationTestFormRequestForbiddenStub::class)->validateResolved();
}

public function test_prepare_for_validation_runs_before_validation()
{
$this->createRequest([], FoundationTestFormRequestHooks::class)->validate();
$this->createRequest([], FoundationTestFormRequestHooks::class)->validateResolved();
}

/**
Expand Down

0 comments on commit 33d8642

Please sign in to comment.