|
|
|
|
@ -25,19 +25,24 @@ namespace OCA\User_LDAP\Tests\Settings; |
|
|
|
|
|
|
|
|
|
use OCA\User_LDAP\Settings\Section; |
|
|
|
|
use OCP\IL10N; |
|
|
|
|
use OCP\IURLGenerator; |
|
|
|
|
use Test\TestCase; |
|
|
|
|
|
|
|
|
|
class SectionTest extends TestCase { |
|
|
|
|
/** @var IL10N */ |
|
|
|
|
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ |
|
|
|
|
private $url; |
|
|
|
|
/** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */ |
|
|
|
|
private $l; |
|
|
|
|
/** @var Section */ |
|
|
|
|
private $section; |
|
|
|
|
|
|
|
|
|
public function setUp() { |
|
|
|
|
parent::setUp(); |
|
|
|
|
$this->l = $this->getMockBuilder('\OCP\IL10N')->getMock(); |
|
|
|
|
$this->url = $this->createMock(IURLGenerator::class); |
|
|
|
|
$this->l = $this->createMock(IL10N::class); |
|
|
|
|
|
|
|
|
|
$this->section = new Section( |
|
|
|
|
$this->url, |
|
|
|
|
$this->l |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
@ -59,4 +64,13 @@ class SectionTest extends TestCase { |
|
|
|
|
public function testGetPriority() { |
|
|
|
|
$this->assertSame(25, $this->section->getPriority()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testGetIcon() { |
|
|
|
|
$this->url->expects($this->once()) |
|
|
|
|
->method('imagePath') |
|
|
|
|
->with('user_ldap', 'app.svg') |
|
|
|
|
->willReturn('icon'); |
|
|
|
|
|
|
|
|
|
$this->assertSame('icon', $this->section->getIcon()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|