Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit d4cd1ed

Browse files
committed
Use class constant instead of strings
1 parent d8a0087 commit d4cd1ed

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/AdldapTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Adldap\Query\Builder;
1212
use Adldap\Schemas\Schema;
1313
use Adldap\Search\Factory;
14+
use Adldap\Contracts\AdldapInterface;
1415
use Illuminate\Support\Facades\App;
1516
use Illuminate\Support\Facades\Auth;
1617

@@ -47,9 +48,9 @@ public function test_registration()
4748

4849
public function test_contract_resolve()
4950
{
50-
$adldap = $this->app->make('Adldap\Contracts\AdldapInterface');
51+
$adldap = $this->app->make(AdldapInterface::class);
5152

52-
$this->assertInstanceOf('Adldap\Contracts\AdldapInterface', $adldap);
53+
$this->assertInstanceOf(AdldapInterface::class, $adldap);
5354
}
5455

5556
public function test_auth_passes()
@@ -94,8 +95,8 @@ public function test_auth_passes_with_persistent_adldap_user()
9495
{
9596
$this->test_auth_passes();
9697

97-
$this->assertInstanceOf('Adldap\Models\User', \Auth::user()->adldapUser);
98-
$this->assertInstanceOf('Adldap\Models\User', auth()->user()->adldapUser);
98+
$this->assertInstanceOf(User::class, \Auth::user()->adldapUser);
99+
$this->assertInstanceOf(User::class, auth()->user()->adldapUser);
99100
}
100101

101102
public function test_auth_passes_without_persistent_adldap_user()
@@ -166,7 +167,7 @@ public function test_auth_fails_when_user_not_found()
166167
public function test_credentials_key_does_not_exist()
167168
{
168169
$mockedProvider = $this->mock(Provider::class);
169-
$mockedSearch = $this->mock('Adldap\Search\Factory');
170+
$mockedSearch = $this->mock(Factory::class);
170171
$mockedSearch->shouldReceive('select')->once()->andReturn($mockedSearch);
171172

172173
$manager = new Manager();
@@ -203,7 +204,7 @@ public function test_config_login_fallback()
203204
$this->app['config']->set('adldap_auth.login_fallback', true);
204205

205206
$mockedProvider = $this->mock(Provider::class);
206-
$mockedSearch = $this->mock('Adldap\Search\Factory');
207+
$mockedSearch = $this->mock(Factory::class);
207208
$mockedSearch->shouldReceive('select')->andReturn($mockedSearch);
208209
$mockedSearch->shouldReceive('whereEquals')->andReturn($mockedSearch);
209210
$mockedSearch->shouldReceive('first')->andReturn(null);

0 commit comments

Comments
 (0)