implement EmailForwarders.listing(); fixes #754
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -191,6 +191,38 @@ class MailsTest extends TestCase
|
||||
$this->assertEquals('other@domain.tld other2@domain.tld', $result['destination']);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testCustomerEmailForwardersAddAnother
|
||||
*/
|
||||
public function testCustomerEmailForwardersListing()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
Settings::Set('panel.customer_hide_options', '', true);
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
$data = [
|
||||
'emailaddr' => 'info@test2.local'
|
||||
];
|
||||
$json_result = EmailForwarders::getLocal($customer_userdata, $data)->listing();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals(2, $result['count']);
|
||||
$this->assertEquals(0, $result['list'][0]['id']);
|
||||
$this->assertEquals('other@domain.tld', $result['list'][0]['address']);
|
||||
$this->assertEquals(1, $result['list'][1]['id']);
|
||||
$this->assertEquals('other2@domain.tld', $result['list'][1]['address']);
|
||||
|
||||
$json_result = EmailForwarders::getLocal($customer_userdata, $data)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals(2, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testCustomerEmailForwardersDeleteEmailHidden
|
||||
@@ -292,13 +324,6 @@ class MailsTest extends TestCase
|
||||
EmailForwarders::getLocal($admin_userdata)->update();
|
||||
}
|
||||
|
||||
public function testAdminEmailForwadersUndefinedListing()
|
||||
{
|
||||
global $admin_userdata;
|
||||
$this->expectExceptionCode(303);
|
||||
EmailForwarders::getLocal($admin_userdata)->listing();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testCustomerEmailForwardersAddAnother
|
||||
|
||||
Reference in New Issue
Block a user