mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-06 08:14:08 +01:00
* Fix "method_argument_space" * Fix "control_structure_continuation_position" * Fix "new_with_parentheses" * Fix "blank_line_before_statement" * Fix "visibility_required" * Fix some "array_indentation" * Fix some "array_indentation" - unify all "rcube::raise_error" calls * rm useless eslint ignores and add rules counts * sort eslint ignores * fix eslint ignores grammar * Revert "Fix "blank_line_before_statement"" * fix CS 3.46.0
38 lines
973 B
PHP
38 lines
973 B
PHP
<?php
|
|
|
|
class ExampleAddressbook_Plugin extends PHPUnit\Framework\TestCase
|
|
{
|
|
public static function setUpBeforeClass(): void
|
|
{
|
|
include_once __DIR__ . '/../example_addressbook.php';
|
|
include_once __DIR__ . '/../example_addressbook_backend.php';
|
|
}
|
|
|
|
/**
|
|
* Plugin object construction test
|
|
*/
|
|
public function test_constructor()
|
|
{
|
|
$rcube = rcube::get_instance();
|
|
$plugin = new example_addressbook($rcube->plugins);
|
|
|
|
$this->assertInstanceOf('example_addressbook', $plugin);
|
|
$this->assertInstanceOf('rcube_plugin', $plugin);
|
|
|
|
$plugin->init();
|
|
}
|
|
|
|
/**
|
|
* Test address_sources()
|
|
*/
|
|
public function test_address_sources()
|
|
{
|
|
$rcube = rcube::get_instance();
|
|
$plugin = new example_addressbook($rcube->plugins);
|
|
|
|
$result = $plugin->address_sources(['sources' => []]);
|
|
|
|
$this->assertSame('static', $result['sources']['static']['id']);
|
|
}
|
|
}
|