Files
roundcubemail/plugins/example_addressbook/tests/ExampleAddressbook.php
Michael Voříšek d18406a8bd Fix binary operator spaces CS (#9330)
* align_single_space_minimal for assign

* assign operators grouping is not supported by PHP CS Fixer

* binary_operator_spaces = single_space

* fix anonymous function on single line

* align comments manually
2024-02-02 07:53:34 +01:00

40 lines
986 B
PHP

<?php
use PHPUnit\Framework\TestCase;
class ExampleAddressbook_Plugin extends 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']);
}
}