You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
PHTML
35 lines
1.1 KiB
PHTML
6 years ago
|
<?php
|
||
|
|
||
|
namespace Engelsystem\Test\Unit\Http\Validation;
|
||
|
|
||
|
use Engelsystem\Application;
|
||
|
use Engelsystem\Http\Validation\ValidationServiceProvider;
|
||
|
use Engelsystem\Http\Validation\Validator;
|
||
|
use Engelsystem\Test\Unit\Http\Validation\Stub\ValidatesRequestImplementation;
|
||
|
use Engelsystem\Test\Unit\ServiceProviderTest;
|
||
|
use stdClass;
|
||
|
|
||
|
class ValidationServiceProviderTest extends ServiceProviderTest
|
||
|
{
|
||
|
/**
|
||
|
* @covers \Engelsystem\Http\Validation\ValidationServiceProvider::register
|
||
|
*/
|
||
|
public function testRegister()
|
||
|
{
|
||
|
$app = new Application();
|
||
|
|
||
|
$serviceProvider = new ValidationServiceProvider($app);
|
||
|
$serviceProvider->register();
|
||
|
|
||
|
$this->assertTrue($app->has(Validator::class));
|
||
|
$this->assertTrue($app->has('validator'));
|
||
|
|
||
|
/** @var ValidatesRequestImplementation $validatesRequest */
|
||
|
$validatesRequest = $app->make(ValidatesRequestImplementation::class);
|
||
|
$this->assertTrue($validatesRequest->hasValidator());
|
||
|
|
||
|
// Test afterResolving early return
|
||
|
$app->make(stdClass::class);
|
||
|
}
|
||
|
}
|