Files
FOSSBilling/tests/integration/bb-modules/mod_profile/Api_AdminTest.php
T
AnyxandBenjamin Aerni 4e8d83eafb Default to Huraga Green & update naming/URL (#295)
* Default to Huraga Green & update naming/URL

* Apply the code from the Orderbutton module that defaults to Huraga Green to all templates that request Huraga's color scheme. Replace incorrect setting.

* Replace some old references to BoxBilling and boxbilling.org with the FOSSBilling ones. Update LICENSE URLs.

* Fix broken test

Co-authored-by: Benjamin Aerni <belleaerni@gmail.com>
2022-09-30 05:09:02 +02:00

43 lines
1.2 KiB
PHP

<?php
/**
* @group Core
*/
class Api_Admin_ProfileTest extends BBDbApiTestCase
{
protected $_initialSeedFile = 'admins.xml';
public function testProfile()
{
$array = $this->api_admin->profile_get();
$this->assertIsArray($array);
$bool = $this->api_admin->profile_logout();
$this->assertTrue($bool);
$data = array(
'email' => 'demo@fossbilling.org',
'name' => 'Demo Admin',
'signature' => 'New Signature',
);
$bool = $this->api_admin->profile_update($data);
$this->assertTrue($bool);
$bool = $this->api_admin->profile_generate_api_key($data);
$this->assertTrue($bool);
}
public function testPassword()
{
$data = array(
'password' => 'demo12313123A',
'password_confirm' => 'demo12313123A',
);
$bool = $this->api_admin->profile_change_password($data);
$this->assertTrue($bool);
$array = $this->api_admin->profile_get();
$password = $this->di['db']->getCell('Select pass from admin where id = ?', array($array['id']));
$this->assertTrue($this->di['password']->verify($data['password'], $password));
}
}