Skip to content

Commit be3447b

Browse files
committed
Fix readme badge and configure service providers in tests
1 parent bfc9ca8 commit be3447b

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<p align="center">Integrate LDAP into your Lumen application.</p>
88

99
<p align="center">
10-
<a href="https://laravel.com"><img src="https://img.shields.io/badge/Built_for-Laravel-green.svg?style=flat-square"></a>
10+
<a href="https://lumen.laravel.com"><img src="https://img.shields.io/badge/Built_for-Lumen-green.svg?style=flat-square"></a>
1111
<a href="https://travis-ci.com/directorytree/ldaprecord-lumen"><img src="https://img.shields.io/travis/directorytree/ldaprecord-lumen.svg?style=flat-square"></a>
1212
<a href="https://scrutinizer-ci.com/g/directorytree/ldaprecord-lumen"><img src="https://img.shields.io/scrutinizer/g/directorytree/ldaprecord-lumen/master.svg?style=flat-square"></a>
1313
<a href="https://packagist.org/packages/directorytree/ldaprecord-lumen"><img src="https://img.shields.io/packagist/dt/directorytree/ldaprecord-lumen.svg?style=flat-square"></a>

tests/LdapServiceProviderTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace LdapRecord\Lumen\Tests;
4+
5+
use LdapRecord\Container;
6+
use LdapRecord\Connection;
7+
use LdapRecord\Lumen\LdapServiceProvider;
8+
9+
class LdapServiceProviderTest extends TestCase
10+
{
11+
protected function setUp(): void
12+
{
13+
parent::setUp();
14+
15+
config(['ldap.default' => 'default']);
16+
config(['ldap.connections.default' => [
17+
'hosts' => ['localhost'],
18+
'username' => 'user',
19+
'password' => 'secret',
20+
]]);
21+
22+
app()->register(LdapServiceProvider::class);
23+
}
24+
25+
public function test_connections_are_registered()
26+
{
27+
$this->assertIsArray($connections = Container::getInstance()->all());
28+
$this->assertCount(1, $connections);
29+
30+
$this->assertInstanceOf(Connection::class, $default = $connections['default']);
31+
$this->assertEquals(['localhost'], $default->getConfiguration()->get('hosts'));
32+
}
33+
}

tests/MakeLdapConfigTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
namespace LdapRecord\Lumen\Tests;
44

55
use Illuminate\Filesystem\Filesystem;
6+
use LdapRecord\Lumen\LdapServiceProvider;
67

78
class MakeLdapConfigTest extends TestCase
89
{
10+
protected function setUp(): void
11+
{
12+
parent::setUp();
13+
14+
app()->register(LdapServiceProvider::class);
15+
}
16+
917
protected function tearDown(): void
1018
{
1119
$this->deleteConfigStub();

tests/bootstrap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
|
7474
*/
7575

76-
$app->register(\LdapRecord\Lumen\LdapServiceProvider::class);
77-
$app->register(\LdapRecord\Lumen\LdapAuthServiceProvider::class);
7876

7977
/*
8078
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)