Files
roundcubemail/plugins/example_addressbook/tests/ExampleAddressbookTest.php
Michael Voříšek 1e360999b2 Use composer autoloader for bundled plugins testing (#9412)
* use fixed "roundcube/plugin-installer"

* Use composer autoloader for plugins testing

* cherrypick remaining from 9241 related with testing

* minor legacy autoload improvements
2024-04-11 18:28:46 +02:00

34 lines
789 B
PHP

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