Files
roundcubemail/plugins/example_addressbook/tests/ExampleAddressbook.php
Michael Voříšek 54f4aa33f9 Fix CS - imports (#9316)
* fix Tests\Browser\TestCase imports

* fix remaining imports

* fix PHPUnit\Framework\TestCase imports

* import GuzzleHttp\Client

* fix remaining

* "php_unit_method_casing" is not todo

* fix "single_line_comment_spacing"

* fix 2nd commit done using older fixer
2024-01-21 19:13:31 +01:00

40 lines
988 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']);
}
}