mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
29 lines
710 B
PHP
29 lines
710 B
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\Models\Ldap;
|
|
use Tests\Support\InteractsWithSettings;
|
|
use Tests\TestCase;
|
|
|
|
class LdapTest extends TestCase
|
|
{
|
|
use InteractsWithSettings;
|
|
use \phpmock\phpunit\PHPMock;
|
|
|
|
public function testConnect()
|
|
{
|
|
$this->settings->enableLdap();
|
|
|
|
$ldap_connect = $this->getFunctionMock("App\\Models", "ldap_connect");
|
|
$ldap_connect->expects($this->once())->willReturn('hello');
|
|
|
|
$ldap_set_option = $this->getFunctionMock("App\\Models", "ldap_set_option");
|
|
$ldap_set_option->expects($this->exactly(3));
|
|
|
|
|
|
$blah = Ldap::connectToLdap();
|
|
$this->assertEquals('hello',$blah,"LDAP_connect should return 'hello'");
|
|
}
|
|
}
|